From e8fd57d5a27be04c811d76da30a6fd01a782cb12 Mon Sep 17 00:00:00 2001 From: 0702Yoon Date: Thu, 15 Aug 2024 03:16:42 +0900 Subject: [PATCH] =?UTF-8?q?refactor=20:=20=EC=9C=A0=EC=A0=80=20=EC=A0=84?= =?UTF-8?q?=EC=B2=B4=20=EC=A1=B0=ED=9A=8C=20(=EC=96=B4=EB=93=9C=EB=AF=BC?= =?UTF-8?q?=20=EB=AF=B8=ED=8F=AC=ED=95=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/member/service/MemberServiceImpl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/com/example/bigbrotherbe/domain/member/service/MemberServiceImpl.java b/src/main/java/com/example/bigbrotherbe/domain/member/service/MemberServiceImpl.java index 59ffd66..d5fc065 100644 --- a/src/main/java/com/example/bigbrotherbe/domain/member/service/MemberServiceImpl.java +++ b/src/main/java/com/example/bigbrotherbe/domain/member/service/MemberServiceImpl.java @@ -264,6 +264,7 @@ public MemberInfoResponse changeMemberInfo(String username) { public List inquireAllMemberInfo() { List memberInfoResponseList = new ArrayList<>(); for(Member member: memberLoader.getAllMember()){ + if(distinguishUser(member.getAffiliations())){ memberInfoResponseList.add(MemberInfoResponse .builder() .email(member.getEmail()) @@ -272,10 +273,20 @@ public List inquireAllMemberInfo() { .updateAt(member.getUpdateAt()) .affiliationListDto(getMemberAffiliationRoleList()) .build()); + } } return memberInfoResponseList; } + private boolean distinguishUser(List affiliations) { + for(AffiliationMember affiliationMember : affiliations){ + if(!"ROLE_USER".equals(affiliationMember.getRole())){ + return false; + } + } + return true; + } + @Override public AffiliationListDto getMemberAffiliationRoleList() {