注意这边需要设置入参的类型()
consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
/**
* 导入运单
*/
@PostMapping(value = "/importMail", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
Result<List<AfterSaleDTO>> importMail(@RequestParam("file") MultipartFile file, @RequestParam String expressCompanyCode) throws IOException {
return orderInfoFeignClient.importMail(file, expressCompanyCode);
}
@ApiOperation("导入运单")
@RequestMapping(value = "/order/info/importMail", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
Result importMail(@RequestPart("file") MultipartFile file, @RequestParam String expressCompanyCode);
fegin
注意这边需要设置入参的类型()
consumes = MediaType.MULTIPART_FORM_DATA_VALUE
并且注意这边需要使用@RequestPart注解,不能使用@RequestParam
其他参数必须加上@RequestParam注解,否则报错
@ApiOperation("导入运单")
@PostMapping(value = "/importMail")
public Result importMail(@RequestParam MultipartFile file, @RequestParam String expressCompanyCode) throws Exception {
orderInfoService.importMail(file, expressCompanyCode);
return Result.OK("成功");
}
http://blog.xqlee.com/article/1072.html