mirror of https://gitee.com/stylefeng/roses
【7.6.0】【sys】【permission】整理获取角色权限绑定列表的业务结构
parent
ee0d7a72cd
commit
1f88b7c743
|
@ -9,6 +9,7 @@ import cn.stylefeng.roses.kernel.sys.modular.role.entity.SysRole;
|
|||
import cn.stylefeng.roses.kernel.sys.modular.role.pojo.request.RoleBindPermissionRequest;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.role.pojo.request.SysRoleRequest;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.role.pojo.response.RoleBindPermissionResponse;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.role.service.PermissionAssignService;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.role.service.SysRoleService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
@ -29,6 +30,9 @@ public class PermissionAssignController {
|
|||
@Resource
|
||||
private SysRoleService sysRoleService;
|
||||
|
||||
@Resource
|
||||
private PermissionAssignService permissionAssignService;
|
||||
|
||||
/**
|
||||
* 获取所有角色列表
|
||||
* <p>
|
||||
|
@ -53,8 +57,8 @@ public class PermissionAssignController {
|
|||
*/
|
||||
@GetResource(name = "获取角色绑定的权限列表", path = "/permission/getRoleBindPermission")
|
||||
public ResponseData<RoleBindPermissionResponse> getRoleBindPermission(@Validated(BaseRequest.detail.class) RoleBindPermissionRequest roleBindPermissionRequest) {
|
||||
|
||||
return new SuccessResponseData<>();
|
||||
RoleBindPermissionResponse roleBindPermission = permissionAssignService.getRoleBindPermission(roleBindPermissionRequest);
|
||||
return new SuccessResponseData<>(roleBindPermission);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package cn.stylefeng.roses.kernel.sys.modular.role.service;
|
||||
|
||||
import cn.stylefeng.roses.kernel.sys.modular.role.pojo.request.RoleBindPermissionRequest;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.role.pojo.response.RoleBindPermissionResponse;
|
||||
|
||||
/**
|
||||
* 角色权限绑定业务
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/6/13 16:13
|
||||
*/
|
||||
public interface PermissionAssignService {
|
||||
|
||||
/**
|
||||
* 获取角色绑定的权限列表
|
||||
* <p>
|
||||
* 角色绑定的权限列表返回的是一个树形结构:
|
||||
* 第一层是应用,第二层是应用下的菜单,第3层是菜单下的菜单功能
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/6/13 14:56
|
||||
*/
|
||||
RoleBindPermissionResponse getRoleBindPermission(RoleBindPermissionRequest roleBindPermissionRequest);
|
||||
|
||||
/**
|
||||
* 构建一个权限树,包含了空的选择状态
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/6/13 16:17
|
||||
*/
|
||||
RoleBindPermissionResponse createSelectTreeStructure();
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package cn.stylefeng.roses.kernel.sys.modular.role.service.impl;
|
||||
|
||||
import cn.stylefeng.roses.kernel.sys.modular.role.pojo.request.RoleBindPermissionRequest;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.role.pojo.response.RoleBindPermissionResponse;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.role.service.PermissionAssignService;
|
||||
|
||||
/**
|
||||
* 角色权限绑定相关的接口
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/6/13 16:14
|
||||
*/
|
||||
public class PermissionAssignServiceImpl implements PermissionAssignService {
|
||||
|
||||
|
||||
@Override
|
||||
public RoleBindPermissionResponse getRoleBindPermission(RoleBindPermissionRequest roleBindPermissionRequest) {
|
||||
// 1. 整理出一个总的响应的结构树,选择状态为空
|
||||
|
||||
|
||||
// 2. 获取角色绑定的应用,菜单,功能列表
|
||||
|
||||
|
||||
// 3. 组合结构树和角色绑定的信息,填充选择状态,封装返回结果
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoleBindPermissionResponse createSelectTreeStructure() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue