ParamPageUtils
This commit is contained in:
parent
2f2bae4aca
commit
297c94110b
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue