spring cloud feign 调用服务注意问题

服务端 rest api

  @RequestMapping(value = "/phone")
  public ResponsePhone getPhone(@RequestParam String uid, @RequestParam List<String> orderidlist){}


客户端
  
  @RequestMapping(value = "/phone")
  ResponsePhone getPhone(@RequestParam String uid, @RequestParam List<String> orderidlist)
  上面这样写 会在启动的时候报错。
  
原因是 不会自动获取 传递的参数名称 如 uid orderidlist

  改成

  @RequestMapping(value = "/phone")
  ResponsePhone getPhone(@RequestParam(value = "uid") String uid, @RequestParam(value = "orderidlist") List<String> orderidlist) {}
原文地址:https://blog.csdn.net/dream8062/article/details/55509532
posted @ 2019-11-21 17:06  星朝  阅读(261)  评论(0编辑  收藏  举报