New file |
| | |
| | | package com.consum.base.core.utils; |
| | | |
| | | import com.walker.db.page.GenericPager; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: 重写分页工具 |
| | | * @date 2023/11/15 15:19 |
| | | */ |
| | | public class PageUtil<T> extends GenericPager<T> { |
| | | |
| | | private List<T> data; |
| | | |
| | | public PageUtil(List<T> data, int pageIndex, int pageSize, int totalRows) { |
| | | super(data, pageIndex, pageSize, totalRows); |
| | | } |
| | | |
| | | public PageUtil(GenericPager mapGenericPager) { |
| | | super(mapGenericPager.getDatas(), mapGenericPager.getPageIndex(), mapGenericPager.getPageSize(), |
| | | (int) mapGenericPager.getTotalRows()); |
| | | } |
| | | |
| | | protected Class<?> buildData() { |
| | | return List.class; |
| | | } |
| | | |
| | | public PageUtil<T> setDatas(List<T> data) { |
| | | if (data != null) { |
| | | this.data = data; |
| | | } |
| | | return this; |
| | | } |
| | | |
| | | public List<T> getDatas() { |
| | | return this.data; |
| | | } |
| | | } |