luo
2023-12-09 cb5ddf074d60b72e35ee4bafaec95530f53d1839
guns-management/src/main/java/com/stylefeng/guns/modular/code/controller/SysRoleController.java
@@ -57,7 +57,9 @@
            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("添加成功");
    }
@@ -80,6 +82,8 @@
        if (result.hasErrors()) {
            throw new GunsException(BizExceptionEnum.REQUEST_NULL);
        }
        role.setDeptid(0);
        role.setPid(0);
        this.roleService.updateById(role);
        return ResultUtil.success("修改成功");
    }
@@ -143,11 +147,12 @@
    @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;
    }
}