From 0d02d968ba0626009dfddfccda2ded84a118a88c Mon Sep 17 00:00:00 2001
From: rain <167982779@qq.com>
Date: Wed, 17 Jul 2024 10:49:45 +0800
Subject: [PATCH] 新增临时文件自动删除定时器,增加巡河喊话,修改水印文件上传方式
---
src/main/java/com/dji/sample/media/controller/FileController.java | 44 +++++++++++++++++++++++++++++++++++++++-----
1 files changed, 39 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/dji/sample/media/controller/FileController.java b/src/main/java/com/dji/sample/media/controller/FileController.java
index e32836a..89feb4d 100644
--- a/src/main/java/com/dji/sample/media/controller/FileController.java
+++ b/src/main/java/com/dji/sample/media/controller/FileController.java
@@ -20,6 +20,7 @@
import java.io.IOException;
import java.net.URL;
import java.util.List;
+import java.util.Objects;
import static com.dji.sample.component.AuthInterceptor.TOKEN_CLAIM;
@@ -65,12 +66,48 @@
@GetMapping("/getMediaInfo")
public ResponseResult mediaInfo(@RequestParam String fileName) {
- return ResponseResult.success(fileService.mediaInfo(fileName));
+
+ Object info = fileService.mediaInfo(fileName);
+ if (info!=null){
+ return ResponseResult.success(info);
+ }
+ return ResponseResult.success("图片正在加载");
}
@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));
+
+ }
+ @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));
+
}
@PostMapping("/{workspace_id}/updateFile")
@@ -82,6 +119,7 @@
@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("删除失败");
@@ -108,9 +146,5 @@
} catch (IOException e) {
e.printStackTrace();
}
- }
- @PostMapping("/{workspace_id}/mark")
- public void eaveMarkFile(@PathVariable(name = "workspace_id") String workspaceId,@RequestBody FileUploadDTO file) throws ImageProcessingException, IOException, FontFormatException {
- fileService.saveMarkFile(workspaceId,file);
}
}
--
Gitblit v1.9.3