Skip to content

FEAT : 채팅 미리보기 반환#79

Open
Hoyoung027 wants to merge 4 commits into
developfrom
feature/2.0/SPRINT-2-topicroom-preview
Open

FEAT : 채팅 미리보기 반환#79
Hoyoung027 wants to merge 4 commits into
developfrom
feature/2.0/SPRINT-2-topicroom-preview

Conversation

@Hoyoung027
Copy link
Copy Markdown
Contributor

💡 PR 작업 내용

  • 기능 관련 작업
  • 버그 수정
  • 코드 개선 및 수정
  • 문서 작성
  • 배포
  • 브랜치
  • 기타 (아래에 자세한 내용 기입해 주세요)

📋 세부 작업 내용

  • 인기 토픽룸 미리보기 응답에 최신 채팅 정보 추가
    • 프론트에서 미리보기 API를 주기적으로 호출하는 방식으로 반영하기로 해, 별도의 웹소켓 통신 없이 채팅 전송 시 마지막 채팅 정보만 저장하고 조회 API에서 반환하도록 구현하였습니다.
    • lastMessage, lastMessageType, lastMessageSenderId, lastMessageSenderNickname, lastChatTime 추가
  • 프론트 요청사항으로 채팅 히스토리 조회 시 채팅방 입장 시각 반환 추가하였습니다.
    • joinedAt + messages 형태로 응답 변경
  • 채팅/토픽룸 일부 구조 정리
    • 헥사고날 구조는 덜어내는 중이나, 타 API 의존성 때문에 전체 제거는 하지 않고 이번 작업에 필요한 부분만 정리하였습니다.

📸 작업 화면 (스크린샷)

💬 리뷰 요구사항(선택)

⚠️ PR하기 전에 확인해 주세요.

  • 로컬테스트를 진행하셨나요?
  • 머지할 브랜치를 확인하셨나요?
  • 관련 label을 선택하셨나요?

⭐ 관련 이슈 번호 [#이슈번호]

🖇️ 기타

  • TopicRoom에 최신 채팅 미리보기용 컬럼이 추가되어 DB 변경이 필요합니다.
    • ddl-auto: update로 설정되어 있어 별도로 DB 변경을 도입하지 않았으며, 배포 이후 반영될 예정입니다.
    • last_message
    • last_message_type
    • last_message_sender_id
  • 채팅 히스토리 조회 응답이 기존 Slice에서 ChatHistoryResponseDto로 변경되었습니다.
  • joinedAttopic_room_user.created_at 기준입니다.

@Hoyoung027 Hoyoung027 requested a review from yooniicode June 1, 2026 16:12
@Hoyoung027 Hoyoung027 self-assigned this Jun 1, 2026
@Hoyoung027 Hoyoung027 requested a review from Immmii as a code owner June 1, 2026 16:12
@Hoyoung027 Hoyoung027 added 🔨 refactor 리팩터링 시 🚀 feat 기능 개발 시 labels Jun 1, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2920691d-94d0-4900-9c08-4786ad1866ed

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Hoyoung027 Hoyoung027 changed the title Feature/2.0/sprint 2 topicroom preview FEAT : 채팅 미리보기 반환 Jun 1, 2026
Copy link
Copy Markdown
Contributor

@Immmii Immmii left a comment

Choose a reason for hiding this comment

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

리뷰 늦어져서 죄송합니다...
수고 하셨습니다~~!

코멘트 조금 남겨두었습니다.
수정하시고 바로 머지하시면 됩니다

Comment on lines +9 to +13
@JsonFormat(
shape = JsonFormat.Shape.STRING,
pattern = "yyyy-MM-dd'T'HH:mm:ss",
timezone = "Asia/Seoul")
LocalDateTime joinedAt,
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.

'이 방과 함께한지 N일이 지났어요' 형식이라,
백엔드 측에서 joinedAt을 기준으로 조회 시 며칠이 경과되었는지 계산해서 N일로 내려보내주는게 좋을 것 같아요!

Comment on lines +111 to 113
public void updateLastChatTime(Long roomId, LocalDateTime now) {
topicRoomRepository.updateLastChatTime(roomId, now);
}
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.

이거 이제 미사용하지 않나요?
관련 조회 쿼리와 함께 삭제해도 될 것 같습니다!

}

private static String formatTimeAgo(LocalDateTime time) {
if (time == null) return "대화 없음";
Copy link
Copy Markdown
Contributor

@Immmii Immmii Jun 5, 2026

Choose a reason for hiding this comment

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

TopicRoom 생성자에서
lastChatTime을 now()로 초기화해서 넣어서, time == null일 경우가 없긴 합니다

TopicRoom 생성자에서 lastChatTime = now() -> lastChatTime = null로 수정하시면 이거 용도에 맞게 쓸 수 있을것 같아용

@Immmii Immmii self-requested a review June 5, 2026 08:57
@Immmii Immmii linked an issue Jun 5, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 refactor 리팩터링 시 🚀 feat 기능 개발 시

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat : 토픽룸 실시간 최신 메시지 조회

2 participants