Esempio n. 1
0
  /**
   * 添加角色
   *
   * @param response
   * @param request
   * @param role
   */
  @RequestMapping(value = "ajaxAddRole", method = RequestMethod.POST)
  public void ajaxAddRole(HttpServletResponse response, HttpServletRequest request, Role role) {
    ResponseMap responseMap = new HashResponseMap();
    try {
      this.roleService.addRole(role);
      responseMap.put("id", role.getId());
      responseMap.setStatus(true);
      responseMap.setInfo("添加角色成功");
    } catch (ServiceException e) {
      responseMap.setStatus(false);
      responseMap.setInfo(e.getMessage());
    }

    WebUtil.writerJson(response, responseMap);
  }
Esempio n. 2
0
 /**
  * 跳转到角色修改页面
  *
  * @param role
  * @return
  */
 @RequestMapping("updateRole")
 public Object updateRole(Role role) {
   return this.roleService.queryRoleById(role.getId());
 }