|
@@ -106,21 +106,28 @@ public class FormDataDto implements Serializable {
|
|
|
private Long nodeId;
|
|
|
|
|
|
|
|
|
+ /******************************* 几个常量 **************************************/
|
|
|
+ public static final int MAX_PAGE_SIZE = 200;
|
|
|
+ public static final int DEFAULT_PAGE_SIZE = 10;
|
|
|
+ public static final int DEFAULT_PAGE_NO = 1;
|
|
|
+
|
|
|
+
|
|
|
public int getLimit() {
|
|
|
try {
|
|
|
return pageNo == 0 ? 0 : (pageNo - 1) * pageSize;
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return 1;
|
|
|
+ return DEFAULT_PAGE_NO;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public int getOffset(){
|
|
|
try {
|
|
|
- return pageSize == 0 ? 10 : pageSize;
|
|
|
+ int pageSize = this.pageSize == 0 ? DEFAULT_PAGE_SIZE : this.pageSize;
|
|
|
+ return Math.min(pageSize, MAX_PAGE_SIZE);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return 10;
|
|
|
+ return DEFAULT_PAGE_SIZE;
|
|
|
}
|
|
|
}
|
|
|
|