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

Feat : 다가오는 크루일정 (조회/세팅조회/세팅수정) 구현 #450

Conversation

GBGreenBravo
Copy link
Collaborator

개요

db : 크루모임 조회정보 저장용 필드(meeting_viewed) 추가

  • 피그마에 기획된 바에 따르면, 크루별로 마이페이지에서의 일정 조회 여부를 달리하기에, 해당 여부를 DB에
    crew_member 테이블에 meeting_viewed의 Boolean 필드로 추가해놨습니다.

feat : 다가오는 크루일정 "조회" 구현

  • MeetingReaderImpl의 getUpcomingMeetingsByUserId(Long userId) 로직
    1. user의 크루 중에서 meetingViewed가 True로 설정돼있는 크루들 조회
    2. 크루id로 변환
    3. 해당 크루들에서 시작시간이 현재시간 이후인(다가오는) 크루일정들 조회
    4. 로그인된 user가 meetingMember로 속해있는 크루일정들만 남도록 필터링
    5. 반환할 List에 모두 저장
  • 최종 반환에서 페이지네이션을 사용하지 않은 이유는, 기획안에서 달력으로 표시될 거라, 한번에 전달하는 방식으로 구현했습니다.

feat : 다가오는 크루일정 "세팅 조회 및 수정" 구현

  • 아래 기획안에서 우측화면을 보시면, 크루별로 크루일정 조회여부를 조회하고 수정할 수 있어야 하기에, 그에 따른 구현입니다.
  • 특이사항은 없습니다!
image
  • 작업사항 중에 변수나 필드명의 경우는 제 선호대로 설정했기에, 피드백 주시면 적극반영하도록 하겠습니다!

closed #446

PR 유형

어떤 변경 사항이 있나요?

  • 새로운 기능 추가
  • 버그 수정
  • CSS 등 사용자 UI 디자인 변경
  • 코드에 영향을 주지 않는 변경사항(오타 수정, 탭 사이즈 변경, 변수명 변경)
  • 코드 리팩토링
  • 주석 추가 및 수정
  • 문서 수정
  • 테스트 추가, 테스트 리팩토링
  • 빌드 부분 혹은 패키지 매니저 수정
  • 파일 혹은 폴더명 수정
  • 파일 혹은 폴더 삭제
  • 배포 및 PR 관련

PR Checklist

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • 커밋 메시지 컨벤션에 맞게 작성했습니다. Commit message convention 참고.
  • 변경 사항에 대한 테스트를 했습니다.(버그 수정/기능에 대한 테스트).

@GBGreenBravo GBGreenBravo added 🛢 DB 데이터베이스 💻 BE 백엔드 ✨ Feature 새로운 기능을 추가한 경우 labels Apr 30, 2024
@GBGreenBravo GBGreenBravo self-assigned this Apr 30, 2024
Copy link
Collaborator

@kkkapuq kkkapuq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

이 화면에 필요한 요소인거 맞죠?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네넵 정확하십니다!

Comment on lines -126 to +133
MeetingMemberDto meetingMemberDto = MeetingMemberDto.of(MeetingMemberPK.of(userId, meetingDto.id()));
meetingMemberStore.removeMember(meetingMemberDto.toEntity());
meetingMemberStore.removeMember(userId, meetingDto.id());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

미팅 멤버를 조회할 때 객체로 처리하지않고 id로 바로 처리하도록 바꾸신 이유가 궁금합니다!

Copy link
Collaborator Author

@GBGreenBravo GBGreenBravo Apr 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아하 작업하다가 CrewMember에 meetingViewed를 추가했어야 하는데, MeetingMember에 추가했었다가 같이 수정된 사항이네요..!

저 경우에 기존의 코드는 MeetingMemberDto를 생성하고 MeetingMember 엔티티로 바꿔서 삭제하고 있었습니다.
그러나 이번의 CrewMember에 meetingViewed가 추가된 것처럼, MeetingMember의 추가확장성을 고려했을 때는
엔티티로 바꿔서 수정할 필요 없이 복합키 기준인 userId와 meetingId로 삭제하는 것이 바람직하다고 생각했습니다!
(기존의 방식을 따르기 위해서는, 이외의 필드들을 조회하고 삭제 전에 정확한 값을 삭제할 엔티티에 담아야하는 불필요한 로직이 발생하기 때문입니다.)

Comment on lines +84 to +89
List<MyMeetingResponse> response = userFacade.getMeetingsByUserId(userPrincipal.id());

return ApiResponse.of(UserMessage.USER_MEETINGS_READ.getMessage(), response);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list라서 responses 가 좋을 것 같습니다! (매우 사소)

Copy link
Collaborator Author

@GBGreenBravo GBGreenBravo Apr 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이런 피드백 언제나 대환영입니다 ㅋㅋㅋ (진심)
반영 완료했습니다~!

@kkkapuq kkkapuq requested a review from c0olcode April 30, 2024 09:28
Copy link
Collaborator

@oxix97 oxix97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다~~

@GBGreenBravo GBGreenBravo force-pushed the feature/#446_My_Upcoming_Crew_Meetings branch from 475b1ac to 4995905 Compare May 8, 2024 06:15
@GBGreenBravo GBGreenBravo merged commit 47bcbd8 into Kernel360:develop May 8, 2024
1 check passed
@GBGreenBravo GBGreenBravo deleted the feature/#446_My_Upcoming_Crew_Meetings branch May 13, 2024 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 BE 백엔드 🛢 DB 데이터베이스 ✨ Feature 새로운 기능을 추가한 경우
Projects
None yet
Development

Successfully merging this pull request may close these issues.

다가오는 크루일정(마이페이지) 구현
3 participants