status 405 reading LogisticsOrderService#getLogistics(Integer,String,Integer,Integer)
当使用feign传参数的时候,需要加上@RequestParam注解,否则对方服务无法识别参数;
@GetMapping("/order/getLogistics")
public ResponseObj getLogistics(
@RequestParam(value = "logisticsType") Integer logisticsType,
@RequestParam(value="token") String token,
@RequestParam(value = "currentPage", defaultValue = "1") Integer currentPage,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);
本文详细解析了在使用Feign进行微服务间调用时,如何正确地传递参数。特别是强调了@RequestParam注解的重要性,没有它,服务端将无法识别前端传来的参数。通过一个具体的示例,展示了如何在GET请求中使用此注解来指定参数名称和默认值。
2165

被折叠的 条评论
为什么被折叠?



