注意两个接口的区别
@Api(tags = "文件")
@RestController
@RequestMapping("/file")
public class UploadController {
@Resource
private FileService fileService;
@ApiOperation("上传文件")
@PostMapping("/fileUpload")
public ResponseModel uploadFile(@RequestPart MultipartFile uploadfile) {
fileService.uploadFile(uploadfile);
return new ResponseModel("200","ok");
}
@ApiOperation("上传文件2")
@PostMapping("/fileUpload2")
public ResponseModel uploadFile2(@RequestPart MultipartFile file) {
fileService.uploadFile(file);
return new ResponseModel("200","ok");
}
}
- feign的对应的controller
@ApiOperation("上传文件")
@PostMapping("/fileUpload")
public ResponseModel uploadFile(@RequestPart MultipartFile uploadfile) {
fileService.uploadFile(uploadfile);
return new ResponseModel("200","ok");
}