-
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-400] feat: 쪽지방 목록 정렬 및 새로운 쪽지 유무 반환 추가, 새로운 쪽지 온 쪽지방 갯수 조회 API, 회원탈퇴 쪽지 null 처리 #191
Conversation
리뷰해드려요~
These changes allow the system to handle new chat messages and update the last seen at time of the recipient. The new endpoint |
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.
코멘트 단 부분 외에는 대부분 null 처리입니다
|
||
return memberBlockUtil.filterBlockedMember(chatRoomDetailResponseDTOList, member, | ||
ChatRoomDetailResponseDTO::memberId); | ||
public CountChatRoomsWithNewChatDTO countChatRoomsWithNewChat(Member member) { |
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 (chat == null) { | ||
return false; | ||
} | ||
LocalDateTime lastDeleteAt = getLastDeleteAtByMember(chatRoom, member); | ||
return lastDeleteAt == null || chat.getCreatedAt().isAfter(lastDeleteAt); | ||
}) | ||
.sorted((chatRoomA, chatRoomB) -> { |
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 (Objects.isNull(chatRoom.getMemberA()) || | ||
Objects.isNull(chatRoom.getMemberB())) { | ||
return toChatRoomDetailResponseDTO(chatRoom, member, chat, false); | ||
} | ||
|
||
Member recipient = chatRoom.getMemberA().getId().equals(member.getId()) ? | ||
chatRoom.getMemberB() : chatRoom.getMemberA(); | ||
|
||
LocalDateTime lastSeenAt = chatRoom.getMemberA().getId().equals(member.getId()) ? | ||
chatRoom.getMemberALastSeenAt() : chatRoom.getMemberBLastSeenAt(); | ||
|
||
boolean hasNewChat = existNewChat(recipient, chatRoom, lastSeenAt); | ||
|
||
return toChatRoomDetailResponseDTO(chatRoom, member, chat, hasNewChat); |
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.
쪽지방 목록 조회 시 새로운 쪽지 유무 추가하는 부분입니다
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
|
||
@Builder | ||
public record CountChatRoomsWithNewChatDTO( | ||
Integer hasNewChatCount |
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.
그냥 newChatCount는 어떤가요? has가 붙으면 boolean을 생각하게 될 것 같습니당
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.
newChatCount보다 좀 더 길지만 확실한 이름으로 변경했슴다
if (Objects.nonNull(memberALastDeleteAt) && Objects.nonNull(memberBLastDeleteAt) | ||
&& canHardDelete(chatRoom, memberALastDeleteAt, memberBLastDeleteAt)) { |
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.
리팩토링할 때 이런 부분은 따로 함수로 빼서 true, false 반환되는 함수를 만든다면 더 읽기 편할 것 같습니당
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~ 이상 없어보이네요 만약 읽으면 그 상태를 바꿔주는 API는 따로 있는건가요?
리뷰해드려요~
The changes made in the code are to add new features to the chat room and chat message functionalities. The new features include checking if there is a new chat message for a given member and chat room, updating the last seen at timestamp for a given member and chat room, and counting the chat rooms with new chat messages for a given member. The changes also include adding new classes and methods to support these new features. |
해당 쪽지방 마지막 조회 시간 추가해서 마지막 조회 시간으로 새 쪽지 있는지 확인만해용 |
⚒️develop의 최신 커밋을 pull 받았나요?
#️⃣ 작업 내용
동작 확인
마지막 쪽지방 읽은 시간 기준 이후에 쪽지가 온 경우 true를 반환
새 쪽지가 눈꽃에서만 왔기 때문에 새로운 쪽지방 갯수 조회 = 1
포비 계정으로 베로에게 쪽지 하나를 보낸 경우 - true반환, 최근 쪽지가 오고 간 순서대로 정렬됌
새로운 쪽지방 갯수 조회 = 2
쪽지방 목록 조회 시 탈퇴한 멤버 (알수없음)으로 처리
탈퇴한 멤버와의 쪽지 상세 조회
💬 리뷰 요구사항(선택)
null 처리 최대한 한다고 했는데 오류 생기면 수정할게요
아직 쪽지방 삭제는 null 처리하고 테스트를 못해봤어요