您当前的位置: 首页 >  http

qq_34412985

暂无认证

  • 0浏览

    0关注

    1061博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Spring Cloud Feign 报:Method not annotated with HTTP method type (ex. GET, POST)

qq_34412985 发布时间:2021-02-07 21:14:58 ,浏览量:0

原因1:继承了BaseFeign  也就是说父类可能已经有相同的方法了,而你在子类又写了一个一样的方法

解决:检查是否有相同请求URL或者方法名一样的FEIGN请求

 

小记:

  如果被调用端,也就是controoler用了基础类型参数,如:public ResultDTO getAllList(Integer page,Integer pageSize);

那么feign在调用时要加参数注解,如下:

 
  1. @RequestMapping(value = "/getList",method = RequestMethod.POST)

  2. public ResultDTO getList(@RequestParam("currentPage") Integer currentPage,@RequestParam("pageSize") Integer pageSize);

要加上@RequestParam 才能识别得到

关注
打赏
1653291990
查看更多评论
立即登录/注册

微信扫码登录

0.0387s