美文网首页
自定义分页

自定义分页

作者: 街角的幸福i | 来源:发表于2018-05-14 17:18 被阅读0次

    PageRequest pageRequest =new PageRequest(paginationRequest.getCurrentPage()-1, paginationRequest.getPageSize());

    Listaccs1= accs.subList((paginationRequest.getCurrentPage()-1)*paginationRequest.getPageSize(),paginationRequest.getCurrentPage()*paginationRequest.getPageSize());

    Page page =new PageImpl(accs1, pageRequest, accs.size());

    PaginationResponse pageResponse =new PaginationResponse(page, Accounts.class);

    pageResponse.setContent(page.getContent());

    pageResponse.setCurrentPage(pageResponse.getCurrentPage() +1);

    return pageResponse;

    相关文章

      网友评论

          本文标题:自定义分页

          本文链接:https://www.haomeiwen.com/subject/ylujdftx.html