Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

전체 일정 보기 - 익명 #157

Closed
f1v3-dev opened this issue Dec 3, 2024 · 3 comments · Fixed by #158 or #163
Closed

전체 일정 보기 - 익명 #157

f1v3-dev opened this issue Dec 3, 2024 · 3 comments · Fixed by #158 or #163
Assignees
Labels
bug Something isn't working

Comments

@f1v3-dev
Copy link
Member

f1v3-dev commented Dec 3, 2024

🚨 어떤 버그인가요?

image

전체 보기를 클릭했을 때, 익명이여도 사용자의 입력한 사용자명이 나오게 됩니다.

@f1v3-dev f1v3-dev added the bug Something isn't working label Dec 3, 2024
f1v3-dev added a commit that referenced this issue Dec 3, 2024
[�Fix] 모임 일정 전체보기 (익명)
@f1v3-dev
Copy link
Member Author

image

사용자명을 익명1, 익명2와 같은 형태로 응답해야 할 것으로 보임

@f1v3-dev f1v3-dev reopened this Dec 11, 2024
@f1v3-dev
Copy link
Member Author

MeetingRepositoryImpl.java - getMeetingTimes 메서드

아래와 같이 변경해봤는데 뭔가 별로인거같은데 더 좋은 방법이 있을까요?

 // 3. 익명 모임이 아닌 경우, 일정을 할당한 사용자의 닉네임 조회 후 추가
        Boolean isAnonymous = from(meeting)
                .where(meeting.meetingUuid.eq(uuid))
                .select(meeting.isAnonymous)
                .fetchOne();

        for (MeetingTime meetingTime : meetingTimeList) {

            // isAnonymous = true 일 경우, 익명1, 익멱2, ... 형식으로 닉네임을 넣어줘야 함
            List<String> 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();

            if (Boolean.FALSE.equals(isAnonymous)) {
                meetingTime.addMemberNames(nicknames);
            } else {
                List<String> anonymousNicknames = new ArrayList<>();
                for (int i = 1; i <= nicknames.size(); i++) {
                    anonymousNicknames.add("익명" + i);
                }

                meetingTime.addMemberNames(anonymousNicknames);
            }
        }

@f1v3-dev
Copy link
Member Author

기존 로직

        // 3. 익명 모임이 아닌 경우, 일정을 할당한 사용자의 닉네임 조회 후 추가
        Boolean isAnonymous = from(meeting)
                .where(meeting.meetingUuid.eq(uuid))
                .select(meeting.isAnonymous)
                .fetchOne();

        if (Boolean.FALSE.equals(isAnonymous)) {
            for (MeetingTime meetingTime : meetingTimeList) {
                List<String> 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);
            }
        }

f1v3-dev added a commit that referenced this issue Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants