-
Notifications
You must be signed in to change notification settings - Fork 0
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
[COZY-432] feat: 사용자가 방에 들어가면 다른 요청들 날리기 #209
Conversation
리뷰해드려요~MateRepository.java
RoomCommandService.java
RoomQueryService.java
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
안쓰는것들 지운거라 무시하셔도 됩니다
if (room.getNumOfArrival() >= room.getMaxMateNum()) { | ||
throw new GeneralException(ErrorStatus._ROOM_FULL); // 방이 가득 찼을 경우 예외 처리 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
방 정원 검사를 중구난방으로 하고 있어서 통일했습니다 (무시해도 됨)
room.arrive(); | ||
room.isRoomFull(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
방 참여시 JOINED STATE로 업데이트
room.arrive(); | ||
room.isRoomFull(); | ||
roomRepository.save(room); | ||
processJoinRequest(existingMate.get(), room); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
재입장하는 경우(status가 EXITED)에 대해 processJoinRequest를 호출합니다
room.isRoomFull(); | ||
roomRepository.save(room); | ||
processJoinRequest(existingMate.get(), room); | ||
clearOtherRoomRequests(memberId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JOINED됐으면 기존 요청들을 날립니다
processJoinRequest(invitee, room); | ||
clearOtherRoomRequests(inviteeId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위랑 동일
private void clearOtherRoomRequests(Long memberId) { | ||
mateRepository.deleteAllByMemberIdAndEntryStatusIn( | ||
memberId, List.of(EntryStatus.PENDING, EntryStatus.INVITED) | ||
); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PENDING, INVITED 상태인 mate를 모두 삭제합니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이부분은 중복되는 코드 묶은거라 무시하셔도 됩니다
3d5eb0a
to
1a6dbe7
Compare
리뷰해드려요~MateRepository.java
RoomCommandService.java
RoomQueryService.java
추가적으로 제안하고 싶은 점은 없습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 훨씬 로직이 깔끔해진것 같습니다!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
⚒️develop의 최신 커밋을 pull 받았나요?
예
#️⃣ 작업 내용
어떤 방에 들어가는 순간 기존 초대 및 참여 요청을 자동으로 날립니다
동작 확인
memberId 99 → 여러방(57,72,37)에 INVITED, PENDING 상태
방장에게 보이는 참여요청 리스트
99번 참여 요청 수락함
37번 JOINED 룸 제외하고 모든 요청 지워짐
98번 요청을 거절했을때는 안날라감
💬 리뷰 요구사항(선택)