feign调用异常:Method has too many Body parameters
解决方法:所有参数必须加上注解
Java
复制代码
1
@RequestMapping(value="/spCommodity/commodityPage", method=RequestMethod.POST)
2
RgoodsList(Pagepage, @RequestBodyCommodityListQOcommodityListQO);// 会报错
get请求:参数要加上注解@RequestParam
post请求:只能有一个@RequestBody,Page属于一个对象,可删除,其余的参数需要加上@RequestParam
feign调用的接口处可修改:
"/commodityPage") (publicRgoodsList(CommodityListQOcommodityListQO){ Page<SpServiceCommodity>page=newPage<>(); // 页数page.setCurrent(commodityListQO.getCurrent()); // 每页显示条数page.setSize(commodityListQO.getSize());