use of com.optimus.common.mybatis.annotation.PageConfig in project luntan by caoawei.
the class PageInterceptor method resolvePageParam.
private void resolvePageParam(Object handler, HttpServletRequest request) {
String $start = request.getParameter(Constant.PAGE_CONFIG_PARAM_START);
String $limit = request.getParameter(Constant.PAGE_CONFIG_PARAM_LIMIT);
int start;
int limit;
if (Utils.isEmpty($start) || Utils.isEmpty($limit)) {
HandlerMethod handlerMethod = (HandlerMethod) handler;
PageConfig pc = handlerMethod.getMethod().getAnnotation(PageConfig.class);
start = pc.start();
limit = pc.limit();
} else {
start = Math.max(Integer.valueOf($start), 0);
limit = Math.min(Integer.valueOf($limit), Integer.MAX_VALUE);
}
PageParam pageParam = PageParam.initWithOffset(start, limit);
ThreadPageUtil.putPageParam(pageParam);
}
Aggregations