【问题标题】:Spring Cloud Feign Client duplicate list valuesSpring Cloud Feign Client 重复列表值
【发布时间】:2015-11-12 22:53:48
【问题描述】:

我有这个接口使用 Spring cloud Feign 映射我的 rest 客户端。

@FeignClient(url = "http://localhost:8080")
public interface RestClient {

    @RequestMapping(value = "?ids={ids}", method = GET)
    List<Posicao> get(@RequestParam(value = "ids") List ids);
}

我的参数中有一个列表,调用客户端我有这个请求:

restClient.get(Arrays.asList(1, 2));

http://localhost:8080/ids=1,2,1,2

它正在复制列表值!

我已经尝试过使用数组、整数和字符串泛型列表,但没有成功。

【问题讨论】:

标签: java spring spring-cloud netflix-feign


【解决方案1】:

@RequestMapping 中删除?ids={ids} 可解决此问题。只有 path 参数需要去那里。

【讨论】:

    猜你喜欢
    • 2015-10-12
    • 2018-02-01
    • 1970-01-01
    • 2022-08-17
    • 2015-08-24
    • 2017-07-23
    • 2018-06-14
    • 2015-10-21
    • 2018-08-31
    相关资源
    最近更新 更多