Skip to content

Commit

Permalink
Merge pull request #165 from dnd-side-project/feature/#164-meeting
Browse files Browse the repository at this point in the history
[FEAT] 모임 참가자 조회 - 익명화
  • Loading branch information
f1v3-dev authored Jan 14, 2025
2 parents 88c669c + debf7d4 commit 500411e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ public void addParticipantInfoList(List<ParticipantInfo> participantInfoList) {
this.participantInfoList.addAll(participantInfoList);
}

public void anonymizeNickname() {
this.participantInfoList.forEach(ParticipantInfo::changeNicknameToAnonymous);
}

@Getter
public static class ParticipantInfo {

private final String nickname;
private String nickname;
private final Boolean isAssigned;
private final Boolean isLeader;

Expand All @@ -42,5 +46,9 @@ public ParticipantInfo(String nickname, Boolean isAssigned, Boolean isLeader) {
this.isAssigned = isAssigned;
this.isLeader = isLeader != null && isLeader;
}

public void changeNicknameToAnonymous() {
this.nickname = "익명";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,13 @@ public MeetingParticipantResponseDto getParticipants(String uuid) {
throw new MeetingNotFoundException();
}

return meetingRepository.getParticipant(uuid);
MeetingParticipantResponseDto response = meetingRepository.getParticipant(uuid);

if (Boolean.TRUE.equals(response.getIsAnonymous())) {
response.anonymizeNickname();
}

return response;
}

/**
Expand Down

0 comments on commit 500411e

Please sign in to comment.