コード例 #1
0
ファイル: RoleController.java プロジェクト: saxisuer/uber
 @RequestMapping(value = "/add")
 public ModelAndView addPage(Role role) {
   List<Map<String, Object>> permissionList = permissionService.getPermissionMap(null);
   Iterator<Map<String, Object>> it = permissionList.iterator();
   List<String> permissiontringList = new ArrayList<>();
   while (it.hasNext()) {
     Map<String, Object> rm = it.next();
     permissiontringList.add(JsonMapper.nonDefaultMapper().toJson(rm));
   }
   role.setPermissionList(permissiontringList);
   return new ModelAndView(ADD, "role", role);
 }
コード例 #2
0
ファイル: RoleController.java プロジェクト: saxisuer/uber
 @RequestMapping(value = "/edit")
 public ModelAndView editPage(Role role) {
   if (null != role && null != role.getId()) {
     role = roleService.getRoleById(role.getId());
     List<Map<String, Object>> permissionList = permissionService.getPermissionMap(role.getId());
     Iterator<Map<String, Object>> it = permissionList.iterator();
     List<String> permissiontringList = new ArrayList<>();
     while (it.hasNext()) {
       Map<String, Object> rm = it.next();
       permissiontringList.add(JsonMapper.nonDefaultMapper().toJson(rm));
     }
     role.setPermissionList(permissiontringList);
   }
   return new ModelAndView(EDIT, "role", role);
 }