Bladeren bron

fix: 将图片上传和报表获取合并在了一个controller中

DingXiaoYu 2 jaren geleden
bovenliggende
commit
6b6d5cba9a

+ 0 - 25
src/main/java/com/seecoder/BlueWhale/controller/ExcelController.java

@@ -1,25 +0,0 @@
-package com.seecoder.BlueWhale.controller;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.seecoder.BlueWhale.service.ExcelService;
-import com.seecoder.BlueWhale.vo.ResultVO;
-
-import org.springframework.web.bind.annotation.GetMapping;
-
-
-@RestController
-@RequestMapping("/api/excel")
-public class ExcelController {
-
-    @Autowired
-    ExcelService excelService;
-
-    @GetMapping
-    public ResultVO<String> export(){
-        return ResultVO.buildSuccess(excelService.export());
-    }
-    
-}

+ 13 - 7
src/main/java/com/seecoder/BlueWhale/controller/ImageController.java → src/main/java/com/seecoder/BlueWhale/controller/ToolsController.java

@@ -1,22 +1,28 @@
 package com.seecoder.BlueWhale.controller;
 
+import com.seecoder.BlueWhale.service.ExcelService;
 import com.seecoder.BlueWhale.service.ImageService;
 import com.seecoder.BlueWhale.vo.ResultVO;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 @RestController
-@RequestMapping("/api/images")
-public class ImageController {
+@RequestMapping("/api")
+public class ToolsController {
     @Autowired
     ImageService imageService;
 
-    @PostMapping
+    @Autowired
+    ExcelService excelService;
+
+    @PostMapping("/images")
     public ResultVO<String> upload(@RequestParam MultipartFile file){
         return ResultVO.buildSuccess(imageService.upload(file));
     }
+
+    @GetMapping("/excel")
+    public ResultVO<String> export(){
+        return ResultVO.buildSuccess(excelService.export());
+    }
 }