调用Katharsis JSONApi JsonApiFindAllWithIds

时间:2016-09-28 20:17:48

标签: java json-api katharsis

我正在使用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) {

您能告诉我使用@JsonApiFindAllWithIds方法的正确网址格式吗?

1 个答案:

答案 0 :(得分:0)

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

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

调用findallwithids方法,同时提供单个方法 我会称之为findone方法。 希望它有所帮助