Ejemplo n.º 1
0
 /**
  * 得到角色列表
  *
  * @param request
  * @param response
  * @param limit
  * @param offset
  * @param search
  * @param order
  * @param sort
  * @return
  * @throws Exception
  */
 @RequestMapping("/getRoleList")
 @ResponseBody
 public Map<String, Object> getRoleList(
     HttpServletRequest request,
     HttpServletResponse response,
     @RequestParam int limit,
     @RequestParam int offset,
     @RequestParam String search,
     @RequestParam String order,
     @RequestParam String sort)
     throws Exception {
   Map<String, Object> map = new HashMap<String, Object>();
   List<Root> list = roleService.getRoleList(offset, limit, sort, order, search);
   map.put("total", roleService.getRoleList(0, -1, sort, order, search).size());
   map.put("rows", list);
   return map;
 }
Ejemplo n.º 2
0
 /**
  * 得到角色列表(角色分配)
  *
  * @param request
  * @param response
  * @param search
  * @param order
  * @param sort
  * @return
  * @throws Exception
  */
 @RequestMapping("/roleList")
 @ResponseBody
 public List<Map<String, Object>> roleList(
     HttpServletRequest request,
     HttpServletResponse response,
     @RequestParam String search,
     @RequestParam String order,
     @RequestParam String sort)
     throws Exception {
   Map<String, Object> map = new HashMap<String, Object>();
   List<Root> list = roleService.getRoleList(0, -1, sort, order, search);
   List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
   for (Root root : list) {
     result.add(GeneralBeanOrMapUtils.convertBean2Map(root));
   }
   return result;
 }