0

我将 Kathatrsis 用于我的 REST API。我也是 JSONApi 规范的新手。我一生都无法弄清楚调用该@JsonApiFindAllWithIds方法的 url 模式。

例如,假设它被注释为:

@JsonApiFindAllWithIds
public Iterable<ThriftType> findAll(Iterable<String> iterable, QueryParams queryParams) {

如果我调用 URL(我的资源称为测试):

http://localhost:8080/test/1?filter[test][otherId][EQ]=9

我希望它能够使用该方法,其中包含1一个包含我的过滤器的可迭代列表和一个查询参数对象。

但是,它调用我的@JsonApiFindOne方法描述为:

@JsonApiFindOne
public ThriftType findOne(String id) {

你能告诉我正确的 url 格式来达到我的@JsonApiFindAllWithIds方法吗?

4

1 回答 1

0

JsonAliFindAllWithIds 适用于需要获取多个 id 值的场景。例如

http://localhost:8080/test/1,2

将调用 findallwithids 方法,而提供单个 Id 将调用 findone 方法。希望能帮助到你

于 2016-10-07T01:00:28.200 回答