From 3f43e40ed1a1e9f66b3ad2862da9dbc4b710c712 Mon Sep 17 00:00:00 2001
From: nishiwei <13126973358@163.com>
Date: Fri, 23 Oct 2026 14:09:47 +0800
Subject: [PATCH] 智云3.0机场1适配内容提交

---
 ard-admin/src/main/java/com/ard/web/controller/sample/media/FileController.java |   41 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/ard-admin/src/main/java/com/ard/web/controller/sample/media/FileController.java b/ard-admin/src/main/java/com/ard/web/controller/sample/media/FileController.java
index 6de7802..21896de 100644
--- a/ard-admin/src/main/java/com/ard/web/controller/sample/media/FileController.java
+++ b/ard-admin/src/main/java/com/ard/web/controller/sample/media/FileController.java
@@ -4,6 +4,9 @@
 import com.ard.sample.common.model.ResponseResult;
 import com.ard.sample.media.model.MediaFileDTO;
 import com.ard.sample.media.service.IFileService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -16,6 +19,7 @@
  * @version 0.2
  * @date 2021/12/9
  */
+@Api(tags = "媒体文件管理")
 @RestController
 @RequestMapping("/dock/media/files")
 public class FileController {
@@ -27,10 +31,17 @@
      * Get information about all the media files in this workspace based on the workspace id.
      * @return
      */
+    @ApiOperation("获取所有媒体文件列表")
     @GetMapping("/files")
     public ResponseResult<PaginationData<MediaFileDTO>> getFilesList(@RequestParam(defaultValue = "1") Long page,
-                               @RequestParam(name = "page_size", defaultValue = "10") Long pageSize) {
-        PaginationData<MediaFileDTO> filesList = fileService.getMediaFilesPagination(page, pageSize);
+                               @RequestParam(name = "page_size", defaultValue = "10") Long pageSize,
+                               @ApiParam(value = "任务ID,筛选指定任务下的文件", required = false)
+                               @RequestParam(name = "job_id", required = false) String jobId,
+                               @ApiParam(value = "开始时间", required = false)
+                               @RequestParam(name = "start_time", required = false) Long startTime,
+                               @ApiParam(value = "结束时间", required = false)
+                               @RequestParam(name = "end_time", required = false) Long endTime) {
+        PaginationData<MediaFileDTO> filesList = fileService.getMediaFilesPagination(page, pageSize, jobId, startTime, endTime);
         return ResponseResult.success(filesList);
     }
 
@@ -40,6 +51,7 @@
      * @param fileId
      * @param response
      */
+    @ApiOperation("根据id获取媒体文件地址")
     @GetMapping("/file/{file_id}/url")
     public void getFileUrl(@PathVariable(name = "file_id") String fileId, HttpServletResponse response) {
 
@@ -50,4 +62,29 @@
             e.printStackTrace();
         }
     }
+
+    /**
+     * 根据任务id获取全部媒体库文件列表
+     *
+     * @param page     页码,默认值为1,从1开始计数
+     * @param pageSize 每页条数,默认值为10,参数名映射为page_size(前端传参用)
+     * @param jobId    任务ID,必填参数,用于筛选指定任务下的媒体文件
+     * @param isType   文件类型筛选标识,非必填(若需必填可加required = true):
+     *                 1 - 筛选图片文件(按 .jpeg/.jpg 扩展名,兼容各机型镜头前缀 W/Z/T/V);
+     *                 0 - 筛选视频文件(按 .mp4 扩展名)
+     * @return 分页的媒体文件列表数据
+     * */
+    @ApiOperation("获取任务中媒体文件列表")
+    @GetMapping("/jobfiles")
+    public ResponseResult<PaginationData<MediaFileDTO>> getJobFiles(@ApiParam(value = "页码,默认1", defaultValue = "1")
+                                                                    @RequestParam(defaultValue = "1") Long page,
+                                                                    @ApiParam(value = "每页条数,默认10", defaultValue = "10")
+                                                                    @RequestParam(name = "page_size", defaultValue = "10") Long pageSize,
+                                                                    @ApiParam(value = "任务ID(必填),筛选指定任务下的文件", required = true)
+                                                                    @RequestParam(name = "job_id") String jobId,
+                                                                    @ApiParam(value = "文件类型筛选:1=图片文件,0=视频文件")
+                                                                    @RequestParam(name = "isType") String isType) {
+        PaginationData<MediaFileDTO> filesList = fileService.getJobFiles(page, pageSize, jobId, isType);
+        return ResponseResult.success(filesList);
+    }
 }

--
Gitblit v1.9.3