| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer saveMediaFile(String workspaceId, FileUploadDTO file){ |
| | | public Integer saveMediaFile(String workspaceId, FileUploadDTO file) throws IOException, ImageProcessingException { |
| | | return fileService.saveFile(workspaceId, file); |
| | | } |
| | | |
| | |
| | | BizCodeEnum.FILE_UPLOAD_CALLBACK.getCode(), mediaFileCount); |
| | | } |
| | | |
| | | private Boolean parseMediaFile(FileUploadCallback callback, WaylineJobDTO job) { |
| | | private Boolean parseMediaFile(FileUploadCallback callback, WaylineJobDTO job) throws ImageProcessingException, IOException, FontFormatException { |
| | | // Set the drone sn that shoots the media |
| | | Optional<DeviceDTO> dockDTO = deviceService.getDeviceBySn(job.getDockSn()); |
| | | dockDTO.ifPresent(dock -> callback.getFile().getExt().setSn(dock.getChildDeviceSn())); |
| | |
| | | String objectKey = callback.getFile().getObjectKey(); |
| | | callback.getFile().setPath(objectKey.substring(objectKey.indexOf("/") + 1, objectKey.lastIndexOf("/"))); |
| | | int count =fileService.saveFile(job.getWorkspaceId(), callback.getFile()); |
| | | try { |
| | | fileService.saveMarkFile(job.getWorkspaceId(), callback.getFile()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | fileService.saveMarkFile(job.getWorkspaceId(), callback.getFile()); |
| | | |
| | | return count > 0; |
| | | } |
| | | |