forked from plusone/plusone-commons
调整代码。
parent
c654ffc0c8
commit
a4e4102087
|
@ -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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue