mirror of https://gitee.com/stylefeng/roses
【8.3.3】【role】更新角色树和角色的树构建
parent
8cb191fc0c
commit
a274908614
|
@ -25,9 +25,10 @@
|
||||||
package cn.stylefeng.roses.kernel.sys.api.pojo.role;
|
package cn.stylefeng.roses.kernel.sys.api.pojo.role;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||||
import cn.stylefeng.roses.kernel.rule.tree.factory.base.AbstractTreeNode;
|
import cn.stylefeng.roses.kernel.rule.tree.factory.base.AbstractSortedTreeNode;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,7 +38,7 @@ import java.util.List;
|
||||||
* @since 2025/1/24 11:16
|
* @since 2025/1/24 11:16
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class SysRoleTreeDTO implements AbstractTreeNode<SysRoleTreeDTO> {
|
public class SysRoleTreeDTO implements AbstractSortedTreeNode<SysRoleTreeDTO> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色分类id或者角色id
|
* 角色分类id或者角色id
|
||||||
|
@ -104,4 +105,11 @@ public class SysRoleTreeDTO implements AbstractTreeNode<SysRoleTreeDTO> {
|
||||||
this.children = childrenNodes;
|
this.children = childrenNodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BigDecimal getSort() {
|
||||||
|
if (nodeType == null) {
|
||||||
|
return new BigDecimal(0);
|
||||||
|
}
|
||||||
|
return new BigDecimal(nodeType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package cn.stylefeng.roses.kernel.sys.modular.role.factory;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.stylefeng.roses.kernel.rule.constants.TreeConstants;
|
import cn.stylefeng.roses.kernel.rule.constants.TreeConstants;
|
||||||
|
import cn.stylefeng.roses.kernel.rule.tree.factory.SortedTreeBuildFactory;
|
||||||
import cn.stylefeng.roses.kernel.sys.api.pojo.role.SysRoleTreeDTO;
|
import cn.stylefeng.roses.kernel.sys.api.pojo.role.SysRoleTreeDTO;
|
||||||
import cn.stylefeng.roses.kernel.sys.modular.role.entity.RoleCategory;
|
import cn.stylefeng.roses.kernel.sys.modular.role.entity.RoleCategory;
|
||||||
import cn.stylefeng.roses.kernel.sys.modular.role.entity.SysRole;
|
import cn.stylefeng.roses.kernel.sys.modular.role.entity.SysRole;
|
||||||
|
@ -57,7 +58,7 @@ public class RoleTreeFactory {
|
||||||
roleTreeList.add(roleTree);
|
roleTreeList.add(roleTree);
|
||||||
}
|
}
|
||||||
|
|
||||||
return roleTreeList;
|
return new SortedTreeBuildFactory<SysRoleTreeDTO>().doTreeBuild(roleTreeList);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue