ParamPageUtils
This commit is contained in:
24
src/main/java/com/sqx/modules/utils/ParamPageUtils.java
Normal file
24
src/main/java/com/sqx/modules/utils/ParamPageUtils.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.sqx.modules.utils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author GYJoker
|
||||
*/
|
||||
public class ParamPageUtils {
|
||||
public static int getPageNum(Map<String, Object> params) {
|
||||
Object page = params.get("page");
|
||||
if (page == null) {
|
||||
return 1;
|
||||
}
|
||||
return Integer.parseInt(page.toString());
|
||||
}
|
||||
|
||||
public static int getPageSize(Map<String, Object> params) {
|
||||
Object limit = params.get("limit");
|
||||
if (limit == null) {
|
||||
return 10;
|
||||
}
|
||||
return Integer.parseInt(limit.toString());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user