缓存部门命名优化

pull/2/head
jian.li 2023-02-24 13:13:10 +08:00
parent c419c1e107
commit c35d4f596a
1 changed files with 3 additions and 3 deletions

View File

@ -76,9 +76,9 @@ public class DeptServiceImpl implements DeptService {
// 第二步:构建缓存 // 第二步:构建缓存
ImmutableMap.Builder<Long, DeptDO> builder = ImmutableMap.builder(); ImmutableMap.Builder<Long, DeptDO> builder = ImmutableMap.builder();
ImmutableMultimap.Builder<Long, DeptDO> parentBuilder = ImmutableMultimap.builder(); ImmutableMultimap.Builder<Long, DeptDO> parentBuilder = ImmutableMultimap.builder();
depts.forEach(sysRoleDO -> { depts.forEach(deptDO -> {
builder.put(sysRoleDO.getId(), sysRoleDO); builder.put(deptDO.getId(), deptDO);
parentBuilder.put(sysRoleDO.getParentId(), sysRoleDO); parentBuilder.put(deptDO.getParentId(), deptDO);
}); });
deptCache = builder.build(); deptCache = builder.build();
parentDeptCache = parentBuilder.build(); parentDeptCache = parentBuilder.build();