diff --git a/src/main/java/com/dnd/jjakkak/domain/meeting/repository/MeetingRepositoryImpl.java b/src/main/java/com/dnd/jjakkak/domain/meeting/repository/MeetingRepositoryImpl.java index f0e03f6..d9bda83 100644 --- a/src/main/java/com/dnd/jjakkak/domain/meeting/repository/MeetingRepositoryImpl.java +++ b/src/main/java/com/dnd/jjakkak/domain/meeting/repository/MeetingRepositoryImpl.java @@ -162,20 +162,26 @@ public PagedResponse getMeetingTimes(String uuid, Pageab .select(dateOfSchedule.dateOfScheduleRank.count()) .fetchCount(); + // 3. 익명 모임이 아닌 경우, 일정을 할당한 사용자의 닉네임 조회 후 추가 + Boolean isAnonymous = from(meeting) + .where(meeting.meetingUuid.eq(uuid)) + .select(meeting.isAnonymous) + .fetchOne(); - // 3. 닉네임 조회 - for (MeetingTime meetingTime : meetingTimeList) { - List nicknames = from(dateOfSchedule) - .join(dateOfSchedule.schedule, schedule) - .join(schedule.meeting, meeting) - .where(meeting.meetingUuid.eq(uuid) - .and(dateOfSchedule.dateOfScheduleStart.eq(meetingTime.getStartTime())) - .and(dateOfSchedule.dateOfScheduleEnd.eq(meetingTime.getEndTime())) - .and(schedule.assignedAt.loe(requestTime))) - .select(schedule.scheduleNickname) - .fetch(); - - meetingTime.addMemberNames(nicknames); + if (Boolean.FALSE.equals(isAnonymous)) { + for (MeetingTime meetingTime : meetingTimeList) { + List nicknames = from(dateOfSchedule) + .join(dateOfSchedule.schedule, schedule) + .join(schedule.meeting, meeting) + .where(meeting.meetingUuid.eq(uuid) + .and(dateOfSchedule.dateOfScheduleStart.eq(meetingTime.getStartTime())) + .and(dateOfSchedule.dateOfScheduleEnd.eq(meetingTime.getEndTime())) + .and(schedule.assignedAt.loe(requestTime))) + .select(schedule.scheduleNickname) + .fetch(); + + meetingTime.addMemberNames(nicknames); + } } // 4. PageInfo 생성