调整代码。

feature/net-util
ZhouXY108 2023-04-29 22:36:25 +08:00
parent c654ffc0c8
commit a4e4102087
1 changed files with 3 additions and 7 deletions

View File

@ -40,6 +40,7 @@ import xyz.zhouxy.plusone.commons.annotation.Overridable;
*/ */
public class PagingAndSortingQueryParams { public class PagingAndSortingQueryParams {
private static final int DEFAULT_PAGE_SIZE = 15;
protected final List<String> orderBy = Lists.newLinkedList(); protected final List<String> orderBy = Lists.newLinkedList();
protected int size; protected int size;
protected long pageNum; protected long pageNum;
@ -96,18 +97,13 @@ public class PagingAndSortingQueryParams {
} }
public final void setPageNum(@Nullable Long pageNum) { public final void setPageNum(@Nullable Long pageNum) {
this.pageNum = pageNum != null ? pageNum : getDefaultPageNum(); this.pageNum = pageNum != null ? pageNum : 1;
} }
// Setters end // Setters end
@Overridable @Overridable
protected int getDefaultSize() { protected int getDefaultSize() {
return 15; return DEFAULT_PAGE_SIZE;
}
@Overridable
protected int getDefaultPageNum() {
return 1;
} }
} }