Collectors.toList() -> .toList()

master
mjkhan21 5 months ago
parent 498a03995e
commit 5791a22a3e

@ -47,7 +47,7 @@ public class AccessContext extends AbstractComponent implements ApplicationConte
implicits = authorities.stream() implicits = authorities.stream()
.filter(authority -> Authority.Type.IMPLICIT.equals(authority.type())) .filter(authority -> Authority.Type.IMPLICIT.equals(authority.type()))
.collect(Collectors.toList()); .toList();
List<DataObject> authorityActions = authorityMapper.getActionList(); List<DataObject> authorityActions = authorityMapper.getActionList();
authorityActions.stream() // 권한별 기능그룹 설정 authorityActions.stream() // 권한별 기능그룹 설정
@ -59,7 +59,7 @@ public class AccessContext extends AbstractComponent implements ApplicationConte
.forEach((authID, byAuth) -> { .forEach((authID, byAuth) -> {
List<String> groupIDs = byAuth.stream() List<String> groupIDs = byAuth.stream()
.map(row -> (String)row.get("GRP_ID")) .map(row -> (String)row.get("GRP_ID"))
.collect(Collectors.toList()); .toList();
Authority authority = authorityIndex.get(authID); Authority authority = authorityIndex.get(authID);
if (authority != null) if (authority != null)
@ -71,7 +71,7 @@ public class AccessContext extends AbstractComponent implements ApplicationConte
.forEach((authID, actions) -> { .forEach((authID, actions) -> {
List<String> actionList = actions.stream() List<String> actionList = actions.stream()
.map(action -> action.string("ACTION")) .map(action -> action.string("ACTION"))
.collect(Collectors.toList()); .toList();
Authority authority = authorityIndex.get(authID); Authority authority = authorityIndex.get(authID);
if (authority != null) if (authority != null)
authority.setActions(actionList); authority.setActions(actionList);
@ -99,7 +99,7 @@ public class AccessContext extends AbstractComponent implements ApplicationConte
return authorityIndex.entrySet().stream() return authorityIndex.entrySet().stream()
.filter(entry -> authIDs.contains(entry.getKey())) .filter(entry -> authIDs.contains(entry.getKey()))
.map(Entry::getValue) .map(Entry::getValue)
.collect(Collectors.toList()); .toList();
} }
/** . /** .
@ -117,6 +117,6 @@ public class AccessContext extends AbstractComponent implements ApplicationConte
return getAuthorities(authIDs).stream() return getAuthorities(authIDs).stream()
.flatMap(authority -> authority.getActions().stream()) .flatMap(authority -> authority.getActions().stream())
.distinct() .distinct()
.collect(Collectors.toList()); .toList();
} }
} }

@ -2,7 +2,6 @@ package cokr.xit.base.security;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -153,7 +152,7 @@ public class SecuredUserInfo extends UserInfo implements UserDetails {
return authorities.stream() return authorities.stream()
.flatMap(auth -> auth.getActions().stream()) .flatMap(auth -> auth.getActions().stream())
.distinct() .distinct()
.collect(Collectors.toList()); .toList();
} }
} }

@ -2,7 +2,6 @@ package cokr.xit.base.security.access.dao;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper; import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
@ -188,7 +187,7 @@ public interface AuthorityMapper extends AbstractMapper {
List<DataObject> list = getUserAuths(params().set("userIDs", List.of(userID))); List<DataObject> list = getUserAuths(params().set("userIDs", List.of(userID)));
return list.stream() return list.stream()
.map(row -> row.string("AUTH_ID")) .map(row -> row.string("AUTH_ID"))
.collect(Collectors.toList()); .toList();
} }
/** . /** .

@ -1,7 +1,6 @@
package cokr.xit.base.security.access.web; package cokr.xit.base.security.access.web;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -71,7 +70,7 @@ public class ActionGroupController extends AbstractController {
ModelAndView mav = getActionGroupList(new ActionQuery().setPageNum(1)); ModelAndView mav = getActionGroupList(new ActionQuery().setPageNum(1));
mav.setViewName("base/actionGroup/select-actionGroup"); mav.setViewName("base/actionGroup/select-actionGroup");
List<DataObject> list = (List<DataObject>)mav.getModel().remove("groupList"); List<DataObject> list = (List<DataObject>)mav.getModel().remove("groupList");
mav.addObject("groupList", toJson(list.stream().filter(info -> !info.bool("builtIn")).collect(Collectors.toList()))); mav.addObject("groupList", toJson(list.stream().filter(info -> !info.bool("builtIn")).toList()));
return mav; return mav;
} }

Loading…
Cancel
Save