【7.0.2】更新角色分配资源的接口名

pull/12/head
fengshuonan 2021-03-20 14:24:40 +08:00
parent ebcf892adf
commit 4be3471fb8
3 changed files with 14 additions and 14 deletions

View File

@ -53,25 +53,25 @@ public class ResourceController {
}
/**
* layui
* Layui--
*
* @author majianguo
* @date 2021/1/9 15:07
*/
@GetResource(name = "获取资源平级树列表,用于分配接口权限", path = "/resource/getLateralTree")
@GetResource(name = "Layui版本--获取资源树列表,用于角色分配接口权限", path = "/resource/getRoleResourceTree")
public List<ResourceTreeNode> getLateralTree(SysRoleRequest sysRoleRequest) {
return sysResourceService.getResourceTree(sysRoleRequest.getRoleId(), true);
return sysResourceService.getResourceTree(sysRoleRequest.getRoleId(), false);
}
/**
* antd vue
* AntdVue--
*
* @author majianguo
* @date 2021/1/9 15:07
*/
@GetResource(name = "获取资源树列表,用于分配接口权限", path = "/resource/getLateralTreeChildren")
@GetResource(name = "AntdVue版本--获取资源树列表,用于角色分配接口权限", path = "/resource/getRoleResourceTreeAntdv")
public ResponseData getLateralTreeChildren(SysRoleRequest sysRoleRequest) {
List<ResourceTreeNode> resourceLateralTree = sysResourceService.getResourceTree(sysRoleRequest.getRoleId(), false);
List<ResourceTreeNode> resourceLateralTree = sysResourceService.getResourceTree(sysRoleRequest.getRoleId(), true);
return new SuccessResponseData(resourceLateralTree);
}

View File

@ -41,14 +41,14 @@ public interface SysResourceService extends IService<SysResource> {
List<SysResource> findList(ResourceRequest resourceRequest);
/**
*
*
*
* @param roleId id
* @param lateralFlag true-false-
* @param roleId id
* @param treeBuildFlag true-false-
* @author majianguo
* @date 2021/1/9 15:08
*/
List<ResourceTreeNode> getResourceTree(Long roleId, Boolean lateralFlag);
List<ResourceTreeNode> getResourceTree(Long roleId, Boolean treeBuildFlag);
/**
* api

View File

@ -85,7 +85,7 @@ public class SysResourceServiceImpl extends ServiceImpl<SysResourceMapper, SysRe
}
@Override
public List<ResourceTreeNode> getResourceTree(Long roleId, Boolean lateralFlag) {
public List<ResourceTreeNode> getResourceTree(Long roleId, Boolean treeBuildFlag) {
List<ResourceTreeNode> res = new ArrayList<>();
@ -162,10 +162,10 @@ public class SysResourceServiceImpl extends ServiceImpl<SysResourceMapper, SysRe
}
// 根据map组装资源树
if (lateralFlag) {
return res;
} else {
if (treeBuildFlag) {
return new DefaultTreeBuildFactory<ResourceTreeNode>().doTreeBuild(res);
} else {
return res;
}
}