| | |
| | | import com.dji.sample.media.model.MediaFileEntity; |
| | | import com.dji.sample.media.model.MediaFileQueryParam; |
| | | import com.dji.sample.media.service.IFileService; |
| | | import com.drew.imaging.ImageProcessingException; |
| | | import org.apache.ibatis.annotations.Update; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.awt.*; |
| | | import java.io.IOException; |
| | | import java.net.URL; |
| | | import java.util.List; |
| | |
| | | return ResponseResult.success(filesList); |
| | | } |
| | | |
| | | @GetMapping("/listAdded") |
| | | public ResponseResult listIsadd() { |
| | | List<MediaFileEntity> entityList = fileService.listByIsadd(); |
| | | @GetMapping("/{workspace_id}/listAdded") |
| | | public ResponseResult listIsadd(@RequestParam String dkbh, |
| | | @PathVariable(name = "workspace_id") String workspaceId) { |
| | | List<MediaFileEntity> entityList = fileService.listByIsadd(dkbh, workspaceId); |
| | | return ResponseResult.success(entityList); |
| | | } |
| | | |
| | | @PutMapping("/examine") |
| | | public ResponseResult examineData(@RequestParam String fileId) { |
| | | int is = fileService.updateExamByFileId(fileId); |
| | | if (is != 0) { |
| | | return ResponseResult.success(); |
| | | } else { |
| | | return ResponseResult.error("更新状态失败"); |
| | | } |
| | | |
| | | return fileService.updateExamByFileId(fileId); |
| | | } |
| | | |
| | | @GetMapping("/getMediaInfo") |
| | | public ResponseResult mediaInfo(@RequestParam String fileId) { |
| | | return ResponseResult.success(fileService.mediaInfo(fileId)); |
| | | public ResponseResult mediaInfo(@RequestParam String fileName) { |
| | | return ResponseResult.success(fileService.mediaInfo(fileName)); |
| | | } |
| | | |
| | | @GetMapping("/{workspace_id}/files/{job_id}") |
| | | public ResponseResult findFilesList(@PathVariable(name = "workspace_id") String workspaceId, @PathVariable(name = "job_id") String jobId) { |
| | | return ResponseResult.success(fileService.listMediaFileEntity(workspaceId, jobId)); |
| | | } |
| | | |
| | | @GetMapping("dataShow/{workspace_id}") |
| | | public ResponseResult getMeidaData(@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.MediaQuery(page, pageSize, updateStart, updateEnd, photoStart, photoEnd, jobName,workspaceId,type)); |
| | | |
| | | } |
| | | |
| | | @PostMapping("/{workspace_id}/updateFile") |
| | |
| | | } |
| | | |
| | | @DeleteMapping("/{workspace_id}/deleteFile") |
| | | |
| | | public ResponseResult deleteFile(@PathVariable(name = "workspace_id") String workspaceId, @RequestParam String fileId) { |
| | | //根据fileId删除图片 |
| | | int count = fileService.deleteMedia(workspaceId, fileId); |
| | | if (count == 0) { |
| | | return ResponseResult.error("删除失败"); |