publish 2.0.0.rc22
This commit is contained in:
@@ -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
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user