【8.3.4】【db】更新一个新的分页方法

master
stylefeng 2025-04-25 17:04:56 +08:00
parent 2766905e17
commit 1091128aee
1 changed files with 16 additions and 0 deletions

View File

@ -74,4 +74,20 @@ public class PageResultFactory {
return pageResult;
}
/**
* Page
*
* @author fengshuonan
* @since 2025/4/25 17:00
*/
public static <T> PageResult<T> createPageResult(Page page, List<T> rows) {
PageResult<T> pageResult = new PageResult<>();
pageResult.setRows(rows);
pageResult.setTotalRows(Convert.toInt(page.getTotal()));
pageResult.setPageNo(Convert.toInt(page.getCurrent()));
pageResult.setPageSize(Convert.toInt(page.getSize()));
pageResult.setTotalPage(PageUtil.totalPage(pageResult.getTotalRows(), pageResult.getPageSize()));
return pageResult;
}
}