Search in sources :

Example 1 with PageQuery

use of com.github.lybgeek.mongodb.common.page.PageQuery in project springboot-learning by lyb-geek.

the class UserServiceImpl method pageUsers.

@Override
public PageResult<User> pageUsers(PageQuery<UserDTO> pageQuery) {
    UserDTO userDTO = pageQuery.getQueryParams();
    User dbUser = getUser(userDTO);
    PageQuery<User> dbPageQuery = new PageQuery<>();
    dbPageQuery.setQueryParams(dbUser);
    dbPageQuery.setPageSize(pageQuery.getPageSize() == null ? 10 : pageQuery.getPageSize());
    dbPageQuery.setPageNum(pageQuery.getPageNum() == null ? 1 : pageQuery.getPageNum());
    PageResult<User> pageResult = userDao.pageUsers(dbPageQuery);
    return pageResult;
}
Also used : User(com.github.lybgeek.mongodb.model.User) PageQuery(com.github.lybgeek.mongodb.common.page.PageQuery) UserDTO(com.github.lybgeek.mongodb.dto.UserDTO)

Aggregations

PageQuery (com.github.lybgeek.mongodb.common.page.PageQuery)1 UserDTO (com.github.lybgeek.mongodb.dto.UserDTO)1 User (com.github.lybgeek.mongodb.model.User)1