@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();
}
CustomerResource.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:java-ee-simple-sample
作者:
评论列表
文章目录