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