|
|
@@ -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());
|
|
|
+ }
|
|
|
}
|