依赖:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>2.0.2.RELEASE</version>
</dependency>
调用方(Feign客户端):
@PostMapping(value = "xxx",consumes = MediaType.MULTIPART_FORM_DATA_VALUE )
ResponseVO<String> xxxx(@RequestPart("file") MultipartFile file);
被调用方:
@PostMapping(value = "xxx")
public ResponseVO<String> xxxx(@RequestParam("file") MultipartFile file){
//xxxx
}
注意:被调用的服务用@RequestParam,不是@RequestPart