From a4e4102087edbf65c6b43ac701fd340f41b0a273 Mon Sep 17 00:00:00 2001 From: ZhouXY108 Date: Sat, 29 Apr 2023 22:36:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/util/PagingAndSortingQueryParams.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/xyz/zhouxy/plusone/commons/util/PagingAndSortingQueryParams.java b/src/main/java/xyz/zhouxy/plusone/commons/util/PagingAndSortingQueryParams.java index 3d261b3..85a3514 100644 --- a/src/main/java/xyz/zhouxy/plusone/commons/util/PagingAndSortingQueryParams.java +++ b/src/main/java/xyz/zhouxy/plusone/commons/util/PagingAndSortingQueryParams.java @@ -40,6 +40,7 @@ import xyz.zhouxy.plusone.commons.annotation.Overridable; */ public class PagingAndSortingQueryParams { + private static final int DEFAULT_PAGE_SIZE = 15; protected final List orderBy = Lists.newLinkedList(); protected int size; protected long pageNum; @@ -96,18 +97,13 @@ public class PagingAndSortingQueryParams { } public final void setPageNum(@Nullable Long pageNum) { - this.pageNum = pageNum != null ? pageNum : getDefaultPageNum(); + this.pageNum = pageNum != null ? pageNum : 1; } // Setters end @Overridable protected int getDefaultSize() { - return 15; - } - - @Overridable - protected int getDefaultPageNum() { - return 1; + return DEFAULT_PAGE_SIZE; } }