Skip to content

[FEAT/#55] chat/view chat - #57

Merged
jiwonniddaaa merged 8 commits into
developfrom
#55-viewChat-jw
Aug 5, 2026
Merged

[FEAT/#55] chat/view chat#57
jiwonniddaaa merged 8 commits into
developfrom
#55-viewChat-jw

Conversation

@jiwonniddaaa

Copy link
Copy Markdown
Collaborator

이슈 번호

#55

작업 내용

  • 채팅방 목록보기
  • 채팅방 상세보기
  • 채팅방 읽음 상태
  • 채팅방 나가기

기타

@jiwonniddaaa jiwonniddaaa self-assigned this Jul 23, 2026
@jiwonniddaaa jiwonniddaaa added the ✨ feature New feature label Jul 23, 2026
import java.time.OffsetDateTime

@MappedSuperclass
abstract class BaseJoinedUpdateEntity {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

BaseJoinedUpdatedTimeEntity로 변경하는 게 조을 것 같음요 (updated 로 변경 + time 붙여서 통일성)

Comment on lines +256 to +263
val senderName = profile?.name ?: "알 수 없는 사용자"
val profileImageUrl = profile?.profileImageUrl

GetChatMessageQueryResponse.of(
messageId = message.chatMessageId!!,
senderId = message.senderId,
senderName = senderName,
profileImageUrl = profileImageUrl,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

senderName이랑 profileImageUrl은 GetChatMessageQueryResponse.of() 함수 안에서 한 번에 받으면 조을 것 같음!

GetChatMessageQueryResponse.of(senderName = profile?.name ?: "알 수 없는 사용자") 이런 식으로!


@Transactional(readOnly = true)
fun getChatRooms(currentUserId: Long): ChatRoomListResponse {
val chatRooms = chatRepository.findByMembersUserId(currentUserId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

여기서도 (leftAt == null) 인 채팅방만 조회하면 어떨까요??

val chatRooms = chatRepository.findByMembersUserIdAndLeftAtIsNull(currentUserId) 이렇게!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

242줄의 로직으로 인해 leftAt을 개인채팅방 재시작 시 null로 바꿔줄 수가 없습니다! 그래서 한번 나간 사람인데 다시 시작한 사람에 대해 걸러줄 수가 없어서 이렇게 수정할 수 없어요..
만약 미리 채팅방 목록을 필터링 할 수 있는 방법은 현재 채팅방에 참여중인 상태를 불리언 컬럼으로 따로 만드는 방법이 있습니다!

이 방법에 대해서는 고민을 같이 해보면 좋겟어요!

Comment thread src/main/kotlin/com/beat_it/chat/service/ChatService.kt
Comment on lines +345 to +346
val chatRoom = findChatRoomOrThrow(chatId)
val member = findChatMemberOrThrow(chatId, userId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

val member = findChatMemberOrThrow(chatId, userId)
val chatRoom = member.chatRoom

이렇게 바꾸면 쿼리를 한 번만 호출할 수 있음!

Comment thread src/main/kotlin/com/beat_it/chat/service/ChatService.kt
Comment thread src/main/kotlin/com/beat_it/chat/service/ChatService.kt
chatRoom = chatRoom,
senderId = userId,
content = "${userName}님이 나갔습니다.",
type = ChatMessageType.TEXT

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

요거 SYSTEM 타입으로 해야 실제 대화처럼 보이지 않고 시스템 알림처럼 나온대
그리고 이렇게 해야 카운트에 영향 없대 (unreadCount 이런거)

@jiwonniddaaa
jiwonniddaaa merged commit 6686018 into develop Aug 5, 2026
@jiwonniddaaa
jiwonniddaaa deleted the #55-viewChat-jw branch August 5, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants