package com.seecoder.BlueWhale.Controller; import com.seecoder.BlueWhale.Service.ToolService; 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.multipart.MultipartFile; // todo: RESTful改造 @RestController @RequestMapping("/api/tool") public class ToolController { @Autowired ToolService toolService; @PostMapping("/upload") public ResultVO upload(@RequestParam MultipartFile file){ return ResultVO.buildSuccess(toolService.upload(file)); } }