| | |
| | | import com.dji.sample.media.model.MediaFileEntity; |
| | | import com.dji.sample.media.model.MediaFileQueryParam; |
| | | import com.dji.sample.media.service.IFileService; |
| | | import com.dji.sample.media.util.ImageDownloaderAndCompressor; |
| | | import com.dji.sample.media.util.MinioFileDownloader; |
| | | import com.drew.imaging.ImageProcessingException; |
| | | import org.apache.ibatis.annotations.Update; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.mock.web.MockHttpServletResponse; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.servlet.http.HttpServletResponseWrapper; |
| | | |
| | | import java.awt.*; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.net.URL; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.dji.sample.component.AuthInterceptor.TOKEN_CLAIM; |
| | | import static com.dji.sample.media.util.ImageDownloaderAndCompressor.*; |
| | | |
| | | /** |
| | | * @author sean |
| | |
| | | return ResponseResult.success(entityList); |
| | | } |
| | | |
| | | @GetMapping("/{workspace_id}/getPhotoByJobId") |
| | | public ResponseResult getPhotoByJobId(@RequestParam String jobId, |
| | | @RequestParam(defaultValue = "1") int page, |
| | | @RequestParam(name = "page_size", defaultValue = "10") int pageSize, |
| | | @PathVariable(name = "workspace_id") String workspaceId |
| | | ) { |
| | | return ResponseResult.success(fileService.getPhotoByJobId(page, pageSize, workspaceId, jobId)); |
| | | } |
| | | |
| | | @GetMapping("/{workspace_id}/getJobIds") |
| | | public ResponseResult getJobIds(@PathVariable(name = "workspace_id") String workspaceId, |
| | | @RequestParam(defaultValue = "1") int page, |
| | | @RequestParam(name = "page_size", defaultValue = "10") int pageSize |
| | | ) { |
| | | return ResponseResult.success(fileService.getJobId(page, pageSize, workspaceId)); |
| | | } |
| | | |
| | | @PutMapping("/examine") |
| | | public ResponseResult examineData(@RequestParam String fileId) { |
| | | return fileService.updateExamByFileId(fileId); |
| | |
| | | public ResponseResult mediaInfo(@RequestParam String fileName) { |
| | | |
| | | Object info = fileService.mediaInfo(fileName); |
| | | if (info!=null){ |
| | | if (info != null) { |
| | | return ResponseResult.success(info); |
| | | } |
| | | return ResponseResult.success("图片正在加载"); |
| | | return ResponseResult.error("图片正在加载"); |
| | | } |
| | | |
| | | @GetMapping("/{workspace_id}/files/{job_id}") |
| | |
| | | @RequestParam(required = false) String type |
| | | ) { |
| | | |
| | | return ResponseResult.success(fileService.MediaQuery(page, pageSize, updateStart, updateEnd, photoStart, photoEnd, jobName, workspaceId, type)); |
| | | return ResponseResult.success(fileService.mediaQuery(page, pageSize, updateStart, updateEnd, photoStart, photoEnd, jobName, workspaceId, type)); |
| | | |
| | | } |
| | | |
| | | @GetMapping("nailDataShow/{workspace_id}") |
| | | public ResponseResult getNailMeidaData(@PathVariable(name = "workspace_id") String workspaceId, |
| | | @RequestParam Integer page, |
| | | @RequestParam(name = "page_size", defaultValue = "10") Integer pageSize, |
| | | @RequestParam(name = "photoStart", required = false) Long updateStart, |
| | | @RequestParam(name = "photoEnd", required = false) Long updateEnd, |
| | | @RequestParam(name = "updateStart", required = false) Long photoStart, |
| | | @RequestParam(name = "updateEnd", required = false) Long photoEnd, |
| | | @RequestParam(name = "jobName", required = false) String jobName, |
| | | @RequestParam(required = false) String type |
| | | ) { |
| | | |
| | | return ResponseResult.success(fileService.mediaNailQuery(page, pageSize, updateStart, updateEnd, photoStart, photoEnd, jobName, workspaceId, type)); |
| | | |
| | | } |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/download-images") |
| | | public ResponseResult downloadImages(@RequestBody List<String> jobIds) { |
| | | return fileService.downloadImages(jobIds); |
| | | } |
| | | } |