首页天道酬勤feign传递参数为对象,feign动态调用url

feign传递参数为对象,feign动态调用url

张世龙 05-06 07:36 93次浏览

springboot上传文件-feign内部调用

1.springboot版本-springboot2.1.6

2.feign间呼叫

注意事项:

1 .注释用: @RequestPart

2 .变量: media type.multipart _ form _ data _ value

3 .无法添加时:required=false

示例:

/**项目共享文件-保存、feign内部调用*/@ request mapping (value='/feign uploadfile ', consumes=media type.multipart _ form _ data _ value (publicvoidfeignuploadfile (@ request part ) value='file ',请求

@feignclient(name='XXX ' ) publicinterfacexxxclient (@ request mapping ) value='/XXX /文件/feign uploadfile ), consumes=media type.multipart _ form _ data _ value (voidfeignuploadfile (@ request part ) value='file ',required }

java将上传文件保存数据库,后端返回文件给前端