
Feign
文章平均质量分 88
行云之流水
来自河北
展开
-
Spring Cloud Feign上传文件
Feign 无法直接传递文件参数,需要在client端引入几个依赖 1. 创建服务端 方式与普通的文件上传方法一致 @RestController @RequestMapping("/producer/upload") class UploadProducer { @PostMapping(value = '/upload', consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_JSON_原创 2020-05-19 11:07:33 · 1307 阅读 · 0 评论 -
Feign 请求动态URL
注意事项 FeignClient 中不要写url, 使用 @RequestLine修饰方法 调用地方必须引入 FeignClientConfiguration, 必须有Decoder, Encoder 调用类必须以构建函数(Constructor) 的方式注入 FeignClient 类 传入URL作为参数; 代码如下: FeignClient类: @CompileStatic @FeignClient(name = "xxxxClient") public interface XxxFeignC.原创 2020-05-19 11:03:17 · 7684 阅读 · 3 评论