From 9f53055abd60eb0fb5d8060587124012d77d8ab6 Mon Sep 17 00:00:00 2001
From: ANDRU-PC\Andru <769883346@qq.com>
Date: 星期四, 23 三月 2023 17:08:44 +0800
Subject: [PATCH] Merge branch 'master' into master-test

---
 phis-feign/src/main/java/com/hz/his/util/PageHelperUtil.java |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/phis-feign/src/main/java/com/hz/his/util/PageHelperUtil.java b/phis-feign/src/main/java/com/hz/his/util/PageHelperUtil.java
index e26e9d7..d3f9ff4 100644
--- a/phis-feign/src/main/java/com/hz/his/util/PageHelperUtil.java
+++ b/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;

--
Gitblit v1.8.0