use of com.myspringboot.entity.UserEntity in project springboot_op by SnailFastGo.
the class UserController method curPage.
@RequestMapping(value = "/curpage")
public List<UserEntity> curPage(int page) {
UserEntity user = new UserEntity();
user.setSize(2);
user.setPage(page);
user.setSort("desc");
Sort.Direction direction = Sort.Direction.DESC;
Sort sort = new Sort(direction, "name");
PageRequest pageRequest = new PageRequest(user.getPage() - 1, user.getSize(), sort);
List<UserEntity> res = userService.curPage(pageRequest);
return res;
}
Aggregations