CustomerResource.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:java-ee-simple-sample 作者:
@GET
public Response getAll(@QueryParam("from") @DefaultValue("0") @Min(0) @Max(100) Integer start,
                       @QueryParam("size") @DefaultValue("5") @Min(1) @Max(10) Integer size) {
    //In a good API-design, pagination (via an envelope or link-headers) would be added to a response that returns a collection.
    //But this is not in the scope of this demo
    List<Customer> customers = customerRepository.findAll(start, size);
    return Response.ok(customers).build();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号