Exemplo n.º 1
0
 /*
  * 管理员查看所有角色
  */
 @Action(value = "/role/getAllRole")
 public String getAllRoles() {
   result = new JSONObject();
   if (page == null) page = 1 + "";
   if (rows == null) rows = 20 + "";
   List<Role> roles =
       roleService.pageList(
           (Integer.parseInt(page) - 1) * Integer.parseInt(rows), Integer.parseInt(rows), -1);
   JSONArray array = new JSONArray();
   Entity2JSONUtil.role2JSON(roles, array);
   result.put("total", roleService.count(-1));
   result.put("rows", array);
   return "json";
 }