| | |
| | | @AllArgsConstructor |
| | | @RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/role") |
| | | @Api(value = "角色", tags = "角色") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public class RoleController extends BladeController { |
| | | |
| | | private final IRoleService roleService; |
| | |
| | | public R<RoleVO> detail(Role role) { |
| | | Role detail = roleService.getOne(Condition.getQueryWrapper(role)); |
| | | return R.data(RoleWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping("/details") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入role") |
| | | public R<Role> details(Role role) { |
| | | Role detail = roleService.getOne(Condition.getQueryWrapper(role)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping("/tree") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "树形结构", notes = "树形结构") |
| | | public R<List<RoleVO>> tree(String tenantId, BladeUser bladeUser) { |
| | | List<RoleVO> tree = roleService.tree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId())); |
| | | public R<List<RoleVO>> tree(String tenantId,Long deptId,BladeUser bladeUser) { |
| | | List<RoleVO> tree = roleService.tree(Func.toStrWithEmpty(tenantId,bladeUser.getTenantId()),deptId); |
| | | return R.data(tree); |
| | | } |
| | | |
| | |
| | | @GetMapping("/tree-by-id") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "树形结构", notes = "树形结构") |
| | | public R<List<RoleVO>> treeById(Long roleId, BladeUser bladeUser) { |
| | | public R<List<RoleVO>> treeById(Long roleId,Long deptId, BladeUser bladeUser) { |
| | | Role role = SysCache.getRole(roleId); |
| | | List<RoleVO> tree = roleService.tree(Func.notNull(role) ? role.getTenantId() : bladeUser.getTenantId()); |
| | | List<RoleVO> tree = roleService.tree(Func.notNull(role) ? role.getTenantId() : bladeUser.getTenantId(),deptId); |
| | | return R.data(tree); |
| | | } |
| | | |
| | |
| | | return R.status(temp); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/selectRole") |
| | | public R selectRole() { |
| | | return R.data(roleService.selectRole()); |
| | | } |
| | | |
| | | |
| | | } |