From 1ad4e77cc910abdb7e95ebea160473526c8ac9ce Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Sun, 08 Oct 2023 17:32:13 +0800
Subject: [PATCH] 添加重复定时和连续执行
---
src/main/java/com/dji/sample/media/controller/FileController.java | 27 +++++++++++++++++++--------
1 files changed, 19 insertions(+), 8 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 8fa8451..6b0c8e8 100644
--- a/src/main/java/com/dji/sample/media/controller/FileController.java
+++ b/src/main/java/com/dji/sample/media/controller/FileController.java
@@ -3,6 +3,8 @@
import com.dji.sample.common.model.PaginationData;
import com.dji.sample.common.model.ResponseResult;
import com.dji.sample.media.model.MediaFileDTO;
+import com.dji.sample.media.model.MediaFileEntity;
+import com.dji.sample.media.model.MediaFileQueryParam;
import com.dji.sample.media.service.IFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -25,30 +27,39 @@
/**
* Get information about all the media files in this workspace based on the workspace id.
+ * 根据工作空间id获取有关此工作空间中所有媒体文件的信息。
* @param workspaceId
* @return
*/
@GetMapping("/{workspace_id}/files")
public ResponseResult<PaginationData<MediaFileDTO>> getFilesList(@RequestParam(defaultValue = "1") Long page,
- @RequestParam(name = "page_size", defaultValue = "10") Long pageSize,
- @PathVariable(name = "workspace_id") String workspaceId) {
- PaginationData<MediaFileDTO> filesList = fileService.getJobsPaginationByWorkspaceId(workspaceId, page, pageSize);
+ @RequestParam(name = "page_size", defaultValue = "10") Long pageSize,
+ @PathVariable(name = "workspace_id") String workspaceId,
+ MediaFileQueryParam mediaFileQueryParam) {
+ PaginationData<MediaFileDTO> filesList = fileService.getMediaFilesPaginationByWorkspaceId(workspaceId, page, pageSize,mediaFileQueryParam);
return ResponseResult.success(filesList);
}
+ @GetMapping("/{workspace_id}/updateFile")
+ public ResponseResult updateFile(@PathVariable(name = "workspace_id") String workspaceId, MediaFileEntity mediaFileEntity) {
+ return ResponseResult.success(fileService.updateMediaFile(workspaceId, mediaFileEntity));
+ }
+
+
+
/**
- * Query the download address of the file according to the media file fingerprint,
+ * Query the download address of the file according to the media file id,
* and redirect to this address directly for download.
* @param workspaceId
- * @param fingerprint
+ * @param fileId
* @param response
*/
- @GetMapping("/{workspace_id}/file/{fingerprint}/url")
+ @GetMapping("/{workspace_id}/file/{file_id}/url")
public void getFileUrl(@PathVariable(name = "workspace_id") String workspaceId,
- @PathVariable String fingerprint, HttpServletResponse response) {
+ @PathVariable(name = "file_id") String fileId, HttpServletResponse response) {
try {
- URL url = fileService.getObjectUrl(workspaceId, fingerprint);
+ URL url = fileService.getObjectUrl(workspaceId, fileId);
response.sendRedirect(url.toString());
} catch (IOException e) {
e.printStackTrace();
--
Gitblit v1.9.3