Skip to content

refactor: 통화방 목록 조회 필드 추가 - #38

Merged
yoonjeonggg merged 1 commit into
mainfrom
refactor/get-rooms
May 20, 2026
Merged

yoonjeonggg merged 1 commit into
mainfrom
refactor/get-rooms

Conversation

@yoonjeonggg

@yoonjeonggg yoonjeonggg commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

통화방 목록 조회 필드 추가

  • host 정보 추가 이름, 프로필 이미지
  • 통화방 생성날짜 추가

Summary by CodeRabbit

  • New Features

    • Room listings now display host profile information including avatar and username.
    • Room creation timestamps now visible in listings.
  • Bug Fixes

    • Fixed duplicate key handling in profile image URL mapping.
  • Refactor

    • Improved room listing performance through batch host profile image loading.
  • Chores

    • Removed obsolete database migration files for schema cleanup.

Review Change Stack

@yoonjeonggg
yoonjeonggg merged commit 250dd03 into main May 20, 2026
0 of 2 checks passed
@coderabbitai

coderabbitai Bot commented May 20, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 531c1437-0d9b-4119-89d8-6e159c91f7a0

📥 Commits

Reviewing files that changed from the base of the PR and between 8f6221e and 164d529.

📒 Files selected for processing (8)
  • src/main/java/chainsawman/gesture/dto/room/response/HostInfo.java
  • src/main/java/chainsawman/gesture/dto/room/response/RoomListResponse.java
  • src/main/java/chainsawman/gesture/service/MediaService.java
  • src/main/java/chainsawman/gesture/service/RoomService.java
  • src/main/resources/db/V1__migrate_quick_slot_preset.sql
  • src/main/resources/db/V2__nullable_media_entity_type.sql
  • src/main/resources/db/V3__nullable_meeting_content.sql
  • src/main/resources/db/V4__add_room_idx_to_meetings.sql

📝 Walkthrough

Walkthrough

This PR refactors room host information representation in room listings. It introduces a new HostInfo DTO to encapsulate host details, updates RoomListResponse with HostInfo and a createdAt timestamp, handles duplicate profile URLs gracefully in MediaService, and optimizes RoomService to batch-fetch host profile URLs instead of fetching them per-room.

Changes

Room Host Information Refactoring

Layer / File(s) Summary
HostInfo DTO and RoomListResponse Refactoring
src/main/java/chainsawman/gesture/dto/room/response/HostInfo.java, src/main/java/chainsawman/gesture/dto/room/response/RoomListResponse.java
New HostInfo DTO with Jackson mappings and Lombok builder exposes userIdx, userName, and profileUrl. Factory method from(User, String) maps User entities and profile URLs. RoomListResponse replaces hostUserIdx with nested HostInfo host, adds createdAt timestamp, and provides from(Room, int, String) factory that normalizes category case, derives password presence, and populates host via HostInfo.from().
RoomService Batch Host URL Fetching and MediaService Duplicate Handling
src/main/java/chainsawman/gesture/service/RoomService.java, src/main/java/chainsawman/gesture/service/MediaService.java
MediaService.getProfileImageUrlMap() adds merge function to retain first value for duplicate user IDs. RoomService.getRooms() and searchRooms() refactored to batch-fetch host profile URLs from the returned page via new fetchHostProfileUrls() helper, then construct each response using RoomListResponse.from(). Removes per-room mapping helper in favor of bulk URL resolution.

Sequence Diagram

sequenceDiagram
  participant RoomService
  participant RoomRepository
  participant MediaService
  participant RoomListResponse
  
  RoomService->>RoomRepository: getRooms(page, pageable)
  RoomRepository-->>RoomService: Page of Room
  RoomService->>RoomService: fetchHostProfileUrls(rooms)
  RoomService->>MediaService: getProfileImageUrlMap(distinct hostIds)
  MediaService-->>RoomService: Map hostId to profileUrl
  RoomService->>RoomListResponse: from(room, participantCount, hostProfileUrl)
  RoomListResponse-->>RoomService: RoomListResponse
  RoomService-->>RoomService: Page of RoomListResponse
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A rabbit hops through host data streams,
Bundling URLs into profile dreams,
HostInfo born, RoomListResponse renewed,
Batch-fetched profiles in grateful mood,
No more per-room delays—optimization brewed! 🐰✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/get-rooms

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant