@Mapping("/u/mainusers")
public Renderer getMainUsersByPage(){
HttpServletRequest reuqest = ActionContext.getActionContext().getHttpServletRequest();
Page page = new Page();
String pageNum = reuqest.getParameter("pageNum");
String pageSize = reuqest.getParameter("pageSize");
if(pageNum!=null&&!pageNum.equals(""))
page.setPageNum(Integer.valueOf(pageNum));
else
page.setPageNum(1);
if(pageSize!=null&&!pageSize.equals("")){
page.setPageSize(Integer.valueOf(pageSize));
}
MainUserService service = new MainUserServiceImpl();
List<MainUser> mainUsers = null;
try {
page = service.getMainUsers(page,null);
} catch (ServiceException e) {
logger.error("����ȡ�������û��б�", e);
String json ="{\"status\":\"0\",\"message\":\"����ȡ�������û��б�!\",\"result\":{}}";
return new TextRenderer(json);
}
reuqest.setAttribute("page",page);
String json ="{\"status\":\"1\",\"page\":"+JSONObject.fromObject(page).toString()+",\"message\":\"��ȡ�������û��б�!\",\"result\":"+JSONArray.fromObject(page.getObjects()).toString()+"}";
System.out.println(json);
return new TextRenderer(json);
}