Skip to content

Comments

feat(#4): 채팅 REST API 계약(Controller/DTO/Swagger/테스트) 추가#13

Merged
Yoonchulchung merged 9 commits intodevfrom
feat/4-chat
Jan 17, 2026
Merged

feat(#4): 채팅 REST API 계약(Controller/DTO/Swagger/테스트) 추가#13
Yoonchulchung merged 9 commits intodevfrom
feat/4-chat

Conversation

@1000hyehyang
Copy link
Member

@1000hyehyang 1000hyehyang commented Jan 17, 2026

요약

채팅 REST API 계약을 확정하기 위해 Controller/DTO/Swagger/Test를 Top-Down 방식으로 구성했습니다.
샘플 응답은 ChatFixtureFactory로 분리했습니다.

변경 사항

  • 채팅 REST 컨트롤러 구성 및 응답 샘플 연동 (ChatController, ChatFixtureFactory)
  • 요청/응답 DTO 및 시스템 메시지 payload 정의
  • 채팅 관련 enum 정리 및 패키지 분리
  • 커서 타입(RoomCursor, MessageCursor)과 변환 컨버터 설정 추가
  • Swagger 명세 최소화 + 요약/설명 보강
image

테스트

  • ChatControllerTest 작성 (MockMvc 기반 계약 테스트)

참고

  • Swagger 테스트를 위해 채팅 url은 다 open 해놨습니다.

@gemini-code-assist
Copy link
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!

이 풀 리퀘스트는 채팅 기능의 REST API 계약을 확립하는 데 중점을 둡니다. 컨트롤러, 데이터 전송 객체(DTO), 스웨거 문서화를 Top-Down 방식으로 구성하여 API의 명확한 구조를 제공합니다. 또한, 테스트를 용이하게 하기 위해 샘플 응답을 생성하는 픽스처 팩토리를 포함하며, 커서 기반 페이지네이션을 위한 유틸리티와 관련 열거형을 정의하여 채팅 시스템의 기반을 마련합니다.

Highlights

  • 채팅 REST API 계약 정의: 채팅 기능의 REST API 계약을 Controller, DTO, Swagger를 포함하여 Top-Down 방식으로 정의했습니다.
  • 샘플 응답을 위한 Fixture Factory 추가: API 테스트 및 문서화를 위해 ChatFixtureFactory를 도입하여 샘플 응답을 제공합니다.
  • 채팅 관련 Enum 및 패키지 구조 개선: 채팅 관련 열거형(Enum)들을 정리하고 패키지를 분리하여 코드의 가독성과 유지보수성을 높였습니다.
  • 커서 기반 페이지네이션 구현: 채팅방 목록 및 메시지 조회를 위한 RoomCursorMessageCursor 타입 및 변환 컨버터를 추가하여 커서 기반 페이지네이션을 지원합니다.
  • Swagger 문서화 및 보안 설정 업데이트: 새로운 채팅 API에 대한 Swagger 명세를 추가하고, 테스트를 위해 /api/chat/** 경로에 대한 보안 설정을 완화했습니다.
  • API 계약 테스트 코드 추가: ChatControllerTest를 작성하여 MockMvc 기반으로 채팅 API의 계약 테스트를 수행합니다.
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
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

이번 PR은 채팅 기능의 REST API 계약을 정의하고, 관련 DTO, 컨트롤러, Swagger 문서 및 테스트 코드를 추가하는 내용이네요. Top-Down 방식으로 구조를 잘 잡으셨고, 특히 FixtureFactory를 사용해 테스트 데이터를 분리한 점과 Swagger 인터페이스를 통해 API 명세를 관리하는 점이 인상적입니다. 전반적으로 깔끔하게 API 계약을 정의하셨습니다. 몇 가지 개선점을 제안드렸습니다. 보안 설정과 관련하여 테스트 목적으로 열어두신 API 엔드포인트는 실제 배포 전에 반드시 인증이 필요하도록 수정해야 합니다. 또한, 커서 파싱 로직에서 발생할 수 있는 예외에 대해 더 구체적인 오류 메시지를 제공하여 API 사용성을 높이는 방안을 제안드렸습니다. 코드 리뷰 참고하시어 더 완성도 높은 코드가 되길 바랍니다.


private static final String[] PERMIT_ALL_URL_ARRAY = {
"/api/test",
"/api/chat/**",
Copy link
Contributor

Choose a reason for hiding this comment

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

high

PR 설명에 Swagger 테스트를 위해 채팅 API(/api/chat/**)를 모두 허용하도록 설정하셨다고 언급해주셨습니다.

개발 및 테스트 단계에서는 편리할 수 있지만, 인증 없이 채팅 관련 엔드포인트에 접근할 수 있게 되어 심각한 보안 위험을 초래할 수 있습니다. 예를 들어, 악의적인 사용자가 다른 사용자의 채팅방에 접근하거나 메시지를 보내는 등의 행위가 가능해질 수 있습니다.

실제 서비스에 배포되기 전에는 반드시 이 설정을 제거하고, @AuthenticationPrincipal을 사용하는 각 엔드포인트에 적절한 인증/인가 로직이 적용되도록 해야 합니다. 개발 환경에서만 이 설정을 적용하고 싶으시다면, Spring Profile을 사용하여 개발용 보안 설정을 분리하는 것을 고려해보시는 것이 좋습니다.

Copy link
Member Author

Choose a reason for hiding this comment

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

로그인 인증 인가 pull 받으면 할거야

@Yoonchulchung
Copy link
Member

API 명세서부터 먼저 작성 부탁드립니다

Copy link
Member

@Yoonchulchung Yoonchulchung left a comment

Choose a reason for hiding this comment

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

넵 좋습니다

@1000hyehyang
Copy link
Member Author

API 명세서부터 먼저 작성 부탁드립니다

넵!!

@Yoonchulchung Yoonchulchung merged commit 7493095 into dev Jan 17, 2026
1 check passed
@Yoonchulchung Yoonchulchung deleted the feat/4-chat branch January 17, 2026 15:59
@Yoonchulchung Yoonchulchung added this to the FE와 API 연동 milestone Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants