fhx
2024-04-11 8aabd6f9a44fb4de7ef2c70ff0a15fc000f4b5d9
phis-feign/src/main/java/com/hz/his/util/PageHelperUtil.java
@@ -11,16 +11,20 @@
 */
public class PageHelperUtil {
    public static <T> PageInfo<T> pageInfo(int currentPage, int pageSize, List list) {
    public static <T> PageInfo<T> pageInfo(Integer currentPage, Integer pageSize, List list) {
        int fromIndex = 0;
        int toIndex = 0;
        //取出总记录数
        int total = list.size();
        //当前页码
        currentPage = (currentPage <= 0) ? 1 : currentPage;
        if (currentPage == null || currentPage <= 0) {
            currentPage = 1;
        }
        //当前页条目数
        pageSize = (pageSize <= 0) ? 10 : (Math.min(pageSize, total));
        if (pageSize == null || pageSize <= 0 || pageSize > 500) {
            pageSize = 20;
        }
        if (total / pageSize == 0 && total % pageSize > 0) {
            fromIndex = 0;