ToolsController.java 599 B

1234567891011121314151617181920
  1. package com.seecoder.BlueWhale.controller;
  2. import com.seecoder.BlueWhale.service.ImageService;
  3. import com.seecoder.BlueWhale.vo.ResultVO;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.web.bind.annotation.*;
  6. import org.springframework.web.multipart.MultipartFile;
  7. @RestController
  8. @RequestMapping("/api")
  9. public class ToolsController {
  10. @Autowired
  11. ImageService imageService;
  12. @PostMapping("/images")
  13. public ResultVO<String> upload(@RequestParam MultipartFile file){
  14. return ResultVO.buildSuccess(imageService.upload(file));
  15. }
  16. }