mirror of
https://gitee.com/likeadmin/likeadmin_java.git
synced 2026-05-08 08:07:46 +08:00
Merge branch 'develop' into feature/generate
This commit is contained in:
@@ -32,6 +32,24 @@ public class PageResult<T> {
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* PageHelper分页(数据额外处理)
|
||||
*
|
||||
* @author fzr
|
||||
* @param list 分页数据集
|
||||
* @param <T> 实体类型
|
||||
* @return PageList
|
||||
*/
|
||||
public static <T> PageResult<T> pageHelper(List<T> list, List<T> data) {
|
||||
PageResult<T> pageResult = new PageResult<>();
|
||||
PageInfo<T> pageInfo = new PageInfo<>(list);
|
||||
pageResult.setCount(pageInfo.getTotal());
|
||||
pageResult.setPageSize(pageInfo.getPageSize());
|
||||
pageResult.setPageNo(pageInfo.getPageNum());
|
||||
pageResult.setLists(data);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* MyBatisPlus分页
|
||||
*
|
||||
@@ -49,7 +67,7 @@ public class PageResult<T> {
|
||||
}
|
||||
|
||||
/**
|
||||
* MyBatisPlus分页
|
||||
* MyBatisPlus分页(数据额外处理)
|
||||
*
|
||||
* @author fzr
|
||||
* @param <T> 实体类型
|
||||
@@ -61,7 +79,6 @@ public class PageResult<T> {
|
||||
pageResult.setPageNo(Math.toIntExact(pageNo));
|
||||
pageResult.setPageSize(Math.toIntExact(size));
|
||||
pageResult.setLists(list);
|
||||
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user