ToolController.java 817 B

12345678910111213141516171819202122
  1. package com.seecoder.BlueWhale.Controller;
  2. import com.seecoder.BlueWhale.Service.ToolService;
  3. import com.seecoder.BlueWhale.VO.ResultVO;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.web.bind.annotation.PostMapping;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7. import org.springframework.web.bind.annotation.RequestParam;
  8. import org.springframework.web.bind.annotation.RestController;
  9. import org.springframework.web.multipart.MultipartFile;
  10. // todo: RESTful改造
  11. @RestController
  12. @RequestMapping("/api/tool")
  13. public class ToolController {
  14. @Autowired
  15. ToolService toolService;
  16. @PostMapping("/upload")
  17. public ResultVO<String> upload(@RequestParam MultipartFile file){
  18. return ResultVO.buildSuccess(toolService.upload(file));
  19. }
  20. }