From 0b03e8ab1e3188c4dd8cbf4b38e220f9118ea2f1 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期四, 25 九月 2025 10:34:41 +0800
Subject: [PATCH] yys  修改巡检bug

---
 src/main/java/com/ruoyi/project/common/CommonController.java |   34 +++++++++++++++++++++++++++-------
 1 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/ruoyi/project/common/CommonController.java b/src/main/java/com/ruoyi/project/common/CommonController.java
index d5a6bcf..21fa5ec 100644
--- a/src/main/java/com/ruoyi/project/common/CommonController.java
+++ b/src/main/java/com/ruoyi/project/common/CommonController.java
@@ -1,9 +1,15 @@
 package com.ruoyi.project.common;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.basic.service.StorageBlobService;
+import com.ruoyi.framework.web.domain.R;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,6 +32,7 @@
  * 
  * @author ruoyi
  */
+@Api(tags = "閫氱敤鎺ュ彛")
 @RestController
 @RequestMapping("/common")
 public class CommonController
@@ -52,16 +59,15 @@
             {
                 throw new Exception(StringUtils.format("鏂囦欢鍚嶇О({})闈炴硶锛屼笉鍏佽涓嬭浇銆� ", fileName));
             }
-            String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
-            String filePath = RuoYiConfig.getDownloadPath() + fileName;
+            String realFileName =  fileName.substring(fileName.indexOf("_") + 1);
 
             response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
             FileUtils.setAttachmentResponseHeader(response, realFileName);
-            FileUtils.writeBytes(filePath, response.getOutputStream());
-            if (delete)
-            {
-                FileUtils.deleteFile(filePath);
-            }
+            FileUtils.writeBytes(fileName, response.getOutputStream());
+//            if (delete)
+//            {
+//                FileUtils.deleteFile(fileName);
+//            }
         }
         catch (Exception e)
         {
@@ -69,6 +75,20 @@
         }
     }
 
+    @Autowired
+    private StorageBlobService storageBlobService;
+
+
+    /**
+     * minio閫氱敤涓婁紶璇锋眰锛堝涓級
+     */
+    @PostMapping("/minioUploads")
+    @ApiOperation(value = "minio閫氱敤涓婁紶璇锋眰")
+    public AjaxResult minioUploadFiles(List<MultipartFile> files, String bucketName, Long type) throws Exception
+    {
+        return AjaxResult.success(storageBlobService.updateStorageBlobs(files, bucketName,type));
+    }
+
     /**
      * 閫氱敤涓婁紶璇锋眰锛堝崟涓級
      */

--
Gitblit v1.9.3