feign 模块间传递文件

pom引入

 io.github.openfeign.form

  feign-form

  3.0.3

  io.github.openfeign.form

  feign-form-spring

  3.0.3

  commons-fileupload

  commons-fileupload

  1.3.3

remoteService


R uploadTemplate(@RequestPart(value = "file") MultipartFile file, @RequestHeader(SecurityConstants.FROM) String from);


class MultipartSupportConfig {

@Autowired

  private ObjectFactorymessageConverters;

  @Bean

  public EncoderfeignFormEncoder() {

return new SpringFormEncoder(new SpringEncoder(messageConverters));

  }

}

你可能感兴趣的:(feign 模块间传递文件)