Skip to content

[FIX] 채팅 opponentName을 브랜드와 크리에이터 분기#330

Merged
1000hyehyang merged 4 commits intodevfrom
fix/329-chat
Feb 8, 2026
Merged

[FIX] 채팅 opponentName을 브랜드와 크리에이터 분기#330
1000hyehyang merged 4 commits intodevfrom
fix/329-chat

Conversation

@1000hyehyang
Copy link
Copy Markdown
Member

Summary

채팅방 상세 응답(ChatRoomDetailResponse)에 myRole 필드를 추가하여 더 깔끔한 설계로 개선했습니다. 프론트엔드는 채팅방 입장 시 1번만 myRole을 받아서 클라이언트 상태로 보관하고, 모든 시스템 메시지 카드 렌더링 시 이를 활용합니다.

Changes

  1. ChatRoomDetailResponsemyRole 필드 추가
    • 채팅방 상세 조회 시 현재 사용자의 역할(BRAND 또는 CREATOR)을 함께 반환
    • 추가 쿼리 없이 기존 getActiveMemberOrThrow 결과에서 getRole()을 추출하여 전달

Type of Change

  • Bug fix (기존 기능에 영향을 주지 않는 버그 수정)
  • New feature (기존 기능에 영향을 주지 않는 새로운 기능 추가)
  • Breaking change (기존 기능에 영향을 주는 수정)
  • Refactoring (기능 변경 없는 코드 개선)
  • Documentation (문서 수정)
  • Chore (빌드, 설정 등 기타 변경)
  • Release (develop → main 배포)

Related Issues

Closes #329

참고 사항

@1000hyehyang 1000hyehyang self-assigned this Feb 8, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @1000hyehyang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 채팅방 상세 응답(ChatRoomDetailResponse)에 현재 사용자의 역할(myRole)을 포함하도록 구조를 개선하여, 프론트엔드에서 시스템 메시지 카드 렌더링 시 필요한 정보를 한 번의 조회로 얻을 수 있게 합니다. 또한, 상대방 정보 조회 로직을 강화하여 상대방의 역할에 따라 브랜드 이름 또는 사용자 닉네임을 정확하게 표시하도록 하여, 채팅방 내 정보 표시의 정확성과 유연성을 높였습니다.

Highlights

  • 채팅방 상세 응답 개선: ChatRoomDetailResponse에 myRole 필드가 추가되어 클라이언트에서 시스템 메시지 렌더링 로직을 간소화할 수 있도록 개선되었습니다.
  • 상대방 정보 조회 로직 강화: 상대방 정보를 조회하는 OpponentInfoService가 ChatRoomMemberRole을 활용하여 브랜드와 크리에이터의 정보를 정확하게 구분하고, 특히 브랜드의 경우 브랜드 이름을 올바르게 표시하도록 로직이 개선되었습니다.
  • 브랜드 정보 일괄 조회 기능 추가: BrandRepository에 여러 사용자 ID로 브랜드를 일괄 조회할 수 있는 findByUserIdIn 메서드가 추가되었습니다.
Changelog
  • src/main/java/com/example/RealMatch/brand/domain/repository/BrandRepository.java
    • 여러 사용자 ID를 통해 Brand 엔티티 목록을 조회하는 findByUserIdIn 메서드를 추가했습니다.
  • src/main/java/com/example/RealMatch/chat/application/service/room/ChatRoomQueryServiceImpl.java
    • getChatRoomDetailWithOpponent 메서드에서 현재 사용자의 ChatRoomMember를 조회하고, 해당 멤버의 roleloadChatRoomDetail 메서드에 전달하도록 변경했습니다.
    • loadChatRoomDetail 메서드의 시그니처를 변경하여 ChatRoomMemberRole myRole 파라미터를 추가하고, ChatRoomDetailResponse 생성 시 myRole을 포함하도록 수정했습니다.
    • opponentInfoService.getOpponentInfo 호출 시 상대방의 ChatRoomMemberRole을 함께 전달하도록 변경했습니다.
  • src/main/java/com/example/RealMatch/chat/application/service/room/OpponentInfoService.java
    • getOpponentInfo 메서드의 인터페이스에 ChatRoomMemberRole role 파라미터를 추가했습니다.
  • src/main/java/com/example/RealMatch/chat/application/service/room/OpponentInfoServiceImpl.java
    • BrandRepository를 주입받도록 변경했습니다.
    • getOpponentInfo 메서드에서 ChatRoomMemberRole에 따라 Brand 정보를 조회하고, 브랜드인 경우 브랜드 이름과 로고 URL을 우선적으로 사용하도록 로직을 추가했습니다.
    • getOpponentInfoMapBatch 메서드에서 상대방 멤버 정보를 OpponentMember 레코드(userId, role)로 관리하도록 변경하고, Brand 정보를 일괄 로드하는 loadOpponentBrands 메서드를 추가했습니다.
    • toOpponentInfo 메서드를 오버로드하여 OpponentMemberBrand 맵을 활용하여 상대방 정보를 구성하도록 개선했습니다.
    • 내부적으로 OpponentMember 레코드(userId, role)를 정의하여 사용합니다.
  • src/main/java/com/example/RealMatch/chat/presentation/dto/response/ChatRoomDetailResponse.java
    • ChatRoomMemberRole myRole 필드를 추가했습니다.
Activity
  • 이 PR은 이슈 #329를 해결합니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

안녕하세요. 채팅방에서 상대방의 역할(브랜드/크리에이터)에 따라 다른 정보를 보여주도록 리팩터링한 점이 인상 깊습니다. 특히 OpponentInfoServiceImpl에서 여러 상대방 정보를 한 번에 효율적으로 가져오도록 배치 로직을 수정한 부분이 좋습니다. 코드 전반적으로 깔끔하게 작성되었으나, N+1 쿼리 문제가 발생할 수 있는 부분을 발견하여 수정을 제안합니다. 자세한 내용은 아래 주석을 참고해주세요.

@1000hyehyang 1000hyehyang merged commit c769e01 into dev Feb 8, 2026
1 check passed
@1000hyehyang 1000hyehyang deleted the fix/329-chat branch February 8, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX] 채팅 opponentName을 브랜드와 크리에이터 분기

1 participant