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());
    }
}
