| | |
| | | throw new GunsException(BizExceptionEnum.REQUEST_NULL); |
| | | } |
| | | role.setId(null); |
| | | role.setInsetTime(new Date()); |
| | | role.setDeptid(0); |
| | | role.setPid(0); |
| | | role.setInsertTime(new Date()); |
| | | this.roleService.insert(role); |
| | | return ResultUtil.success("添加成功"); |
| | | } |
| | |
| | | if (result.hasErrors()) { |
| | | throw new GunsException(BizExceptionEnum.REQUEST_NULL); |
| | | } |
| | | role.setDeptid(0); |
| | | role.setPid(0); |
| | | this.roleService.updateById(role); |
| | | return ResultUtil.success("修改成功"); |
| | | } |
| | |
| | | |
| | | |
| | | @GetMapping(value = "/roleTreeList") |
| | | @ApiOperation(value = "获取上级名称", tags = {"后台-角色管理"}) |
| | | @ApiOperation(value = "获取角色下拉框", tags = {"后台-角色管理"}) |
| | | @ResponseBody |
| | | public List<ZTreeNode> roleTreeList() { |
| | | List<ZTreeNode> roleTreeList = this.roleService.roleTreeList(); |
| | | roleTreeList.add(ZTreeNode.createParent()); |
| | | return roleTreeList; |
| | | public List<Role> roleTreeList() { |
| | | // List<ZTreeNode> roleTreeList = this.roleService.roleTreeList(); |
| | | // roleTreeList.add(ZTreeNode.createParent()); |
| | | return roleService.selectList(null); |
| | | // return roleTreeList; |
| | | } |
| | | } |