[FEAT/#55] chat/view chat - #57
Conversation
page, size 조정 필요
프로필 사진, 읽음 상태 관련 업데이트 필요
| import java.time.OffsetDateTime | ||
|
|
||
| @MappedSuperclass | ||
| abstract class BaseJoinedUpdateEntity { |
There was a problem hiding this comment.
BaseJoinedUpdatedTimeEntity로 변경하는 게 조을 것 같음요 (updated 로 변경 + time 붙여서 통일성)
| val senderName = profile?.name ?: "알 수 없는 사용자" | ||
| val profileImageUrl = profile?.profileImageUrl | ||
|
|
||
| GetChatMessageQueryResponse.of( | ||
| messageId = message.chatMessageId!!, | ||
| senderId = message.senderId, | ||
| senderName = senderName, | ||
| profileImageUrl = profileImageUrl, |
There was a problem hiding this comment.
senderName이랑 profileImageUrl은 GetChatMessageQueryResponse.of() 함수 안에서 한 번에 받으면 조을 것 같음!
GetChatMessageQueryResponse.of(senderName = profile?.name ?: "알 수 없는 사용자") 이런 식으로!
|
|
||
| @Transactional(readOnly = true) | ||
| fun getChatRooms(currentUserId: Long): ChatRoomListResponse { | ||
| val chatRooms = chatRepository.findByMembersUserId(currentUserId) |
There was a problem hiding this comment.
여기서도 (leftAt == null) 인 채팅방만 조회하면 어떨까요??
val chatRooms = chatRepository.findByMembersUserIdAndLeftAtIsNull(currentUserId) 이렇게!
There was a problem hiding this comment.
242줄의 로직으로 인해 leftAt을 개인채팅방 재시작 시 null로 바꿔줄 수가 없습니다! 그래서 한번 나간 사람인데 다시 시작한 사람에 대해 걸러줄 수가 없어서 이렇게 수정할 수 없어요..
만약 미리 채팅방 목록을 필터링 할 수 있는 방법은 현재 채팅방에 참여중인 상태를 불리언 컬럼으로 따로 만드는 방법이 있습니다!
이 방법에 대해서는 고민을 같이 해보면 좋겟어요!
| val chatRoom = findChatRoomOrThrow(chatId) | ||
| val member = findChatMemberOrThrow(chatId, userId) |
There was a problem hiding this comment.
val member = findChatMemberOrThrow(chatId, userId)
val chatRoom = member.chatRoom이렇게 바꾸면 쿼리를 한 번만 호출할 수 있음!
| chatRoom = chatRoom, | ||
| senderId = userId, | ||
| content = "${userName}님이 나갔습니다.", | ||
| type = ChatMessageType.TEXT |
There was a problem hiding this comment.
요거 SYSTEM 타입으로 해야 실제 대화처럼 보이지 않고 시스템 알림처럼 나온대
그리고 이렇게 해야 카운트에 영향 없대 (unreadCount 이런거)
이슈 번호
작업 내용
기타