From c858ae26143fde37b8c77d403baeb7a050bc2ab6 Mon Sep 17 00:00:00 2001
From: zf <1603559716@qq.com>
Date: 星期一, 25 九月 2023 15:17:42 +0800
Subject: [PATCH] 非煤相关接口

---
 ruoyi-file/src/main/java/com/ruoyi/file/controller/AttachmentController.java |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/ruoyi-file/src/main/java/com/ruoyi/file/controller/AttachmentController.java b/ruoyi-file/src/main/java/com/ruoyi/file/controller/AttachmentController.java
index 6d57562..3f61a78 100644
--- a/ruoyi-file/src/main/java/com/ruoyi/file/controller/AttachmentController.java
+++ b/ruoyi-file/src/main/java/com/ruoyi/file/controller/AttachmentController.java
@@ -4,6 +4,10 @@
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.file.constants.FileProjectConstants;
 import com.ruoyi.file.service.AttachmentService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -17,6 +21,7 @@
  * @date: 2023/8/29
  * @time: 10:53
  */
+@Api(tags = "附件")
 @RestController
 @RequestMapping("attachment")
 public class AttachmentController extends BaseController {
@@ -30,7 +35,7 @@
      * @param key
      * @return
      */
-
+    @ApiOperation(value = "根据标识查询文件具体信息")
     @GetMapping("/get/key/{key}")
     public AjaxResult findByKey(@PathVariable String key) {
         return success(attachmentService.findByKey(key));
@@ -52,6 +57,7 @@
      * @param id
      * @return
      */
+    @ApiOperation(value = "删除文件数据")
     @GetMapping("/delete/{id}")
     public AjaxResult delete(@PathVariable Long id) {
         attachmentService.delete(id);
@@ -64,7 +70,11 @@
      * @Description 上传文件(返回文件标识)
      * @Param [file, module]
      **/
-
+    @ApiOperation(value = "上传文件(返回文件标识)")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "file", value = "文件",required = true),
+            @ApiImplicitParam(name = "module", dataTypeClass = String.class,value = "模块",required = true,example = "accountPath"),
+    })
     @PostMapping("/upload/key")
     public AjaxResult uploadReturnKey(@RequestParam("file") MultipartFile
                                        file, @RequestParam("module") String module) {
@@ -76,6 +86,11 @@
      * @Description 上传文件(返回文件信息)
      * @Param [file, module]
      **/
+    @ApiOperation(value = "上传文件(返回文件信息)")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "file",value = "文件",required = true),
+            @ApiImplicitParam(name = "module", dataTypeClass = String.class,value = "模块",required = true,example = "accountPath"),
+    })
     @PostMapping("/upload/detail")
     public AjaxResult uploadReturnDetail(@RequestParam("file") MultipartFile
                                           file, @RequestParam("module") String module) {
@@ -87,6 +102,11 @@
      * @Date 2021/4/20 19:28
      * @Param [file, module]
      **/
+    @ApiOperation(value = "上传文件(返回访问路径)")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "file",value = "文件",required = true),
+            @ApiImplicitParam(name = "module", dataTypeClass = String.class,value = "模块",required = true,example = "accountPath"),
+    })
     @PostMapping("/upload/url")
     public AjaxResult uploadReturnUrl(@RequestParam("file") MultipartFile file, @RequestParam("module") String module) {
         return success(attachmentService.saveFileToPath(file, module, FileProjectConstants.ReturnType.URL));
@@ -97,6 +117,11 @@
      * @Description 上传文件(返回文件信息)
      * @Param [file, module]
      **/
+    @ApiOperation(value = "批量上传文件(返回文件信息)")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "file", value = "文件",required = true),
+            @ApiImplicitParam(name = "module", dataTypeClass = String.class,value = "模块",required = true,example = "accountPath"),
+    })
     @PostMapping("/upload/batch/detail")
     public AjaxResult uploadBatchReturnDetail(@RequestParam("file") MultipartFile[]
                                                file, @RequestParam("module") String module) {

--
Gitblit v1.9.2