publish 2.0.0.rc22

This commit is contained in:
曾文豪
2024-08-09 18:24:47 +08:00
parent a1c75d010b
commit d4e97babf4
14 changed files with 38 additions and 24 deletions

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>2.0.0.rc21</version>
<version>2.0.0.rc22</version>
</parent>
<artifactId>springboot-role</artifactId>

View File

@@ -2,12 +2,23 @@ package com.tiesheng.role.pojos.vo;
import com.tiesheng.role.pojos.dao.CoreRoleAuthority;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
public class ServiceMenuVO extends CoreRoleAuthority {
private List<ServiceMenuVO> children;
/**
* 排序
*/
public ServiceMenuVO sortChildren() {
children = children.stream().sorted(Comparator.comparingInt(ServiceMenuVO::getSort))
.collect(Collectors.toList());
return this;
}
///////////////////////////////////////////////////////////////////////////
// setter\getter
///////////////////////////////////////////////////////////////////////////

View File

@@ -214,7 +214,10 @@ public class CoreRoleService extends TsServiceBase<CoreRoleGroupMapper, CoreRole
return menuChildrenWrap(ownerAuthorityList.stream()
.filter(it -> Objects.equals(it.getType(), "group") || Objects.equals(it.getType(), "menu"))
.collect(Collectors.toList()), null);
.collect(Collectors.toList()), null)
.stream().sorted(Comparator.comparingInt(ServiceMenuVO::getSort))
.map(ServiceMenuVO::sortChildren)
.collect(Collectors.toList());
}