Skip to content

Conversation

@HyemIin
Copy link
Member

@HyemIin HyemIin commented Jun 16, 2025

작업 요약

  • 에러handler에 @hidden 으로 변경
  • 각 컨트롤러 메서드에 스웨거 어노테이션 추가

Issue Link

#28

문제점 및 어려움

해결 방안

Reference

Summary by CodeRabbit

  • 문서화
    • Store API와 User API의 모든 엔드포인트에 대해 Swagger(OpenAPI) 문서화 주석이 추가되었습니다. 각 API의 목적 및 응답 코드가 명확하게 표시됩니다.
    • 예외 처리 관련 클래스가 API 문서에서 숨김 처리되어 Swagger 문서에 노출되지 않습니다.

- 에러handler에 @hidden 으로 변경
- 각 컨트롤러 메서드에 스웨거 어노테이션 추가
@HyemIin HyemIin self-assigned this Jun 16, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jun 16, 2025

Walkthrough

이번 변경 사항은 Swagger(OpenAPI) 문서화를 위해 컨트롤러와 예외 처리 클래스에 관련 어노테이션을 추가 및 수정한 작업입니다. 기존의 프로필 기반 활성화 방식 대신 문서화 관련 어노테이션으로 대체하였으며, API 엔드포인트에 설명 및 응답 정보를 명확히 주석 처리하였습니다.

Changes

파일/경로 변경 요약
.../global/security/exception/GlobalExceptionHandler.java 클래스 어노테이션을 @Profile("!swagger")에서 @Hidden으로 변경하여 Swagger 문서에서 숨김 처리
.../store/controller/StoreController.java 클래스 및 모든 엔드포인트에 @Tag, @Operation, @ApiResponse 등 Swagger 문서화 어노테이션 추가
.../user/controller/UserController.java 클래스 및 모든 엔드포인트에 @Tag, @Operation, @ApiResponse 등 Swagger 문서화 어노테이션 추가

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant StoreController
    participant UserController

    Client->>StoreController: API 요청 (예: 가게 목록 조회)
    StoreController-->>Client: 응답 (Swagger 문서화 주석 포함)

    Client->>UserController: API 요청 (예: 회원가입/로그인/내 정보 조회)
    UserController-->>Client: 응답 (Swagger 문서화 주석 포함)
Loading

Possibly related PRs

  • feat(global): swagger 설정 #31: GlobalExceptionHandler@Profile("!swagger") 어노테이션을 최초로 도입한 PR로, 이번 변경과 직접적으로 연결됩니다.

Poem

📝
Swagger의 빛으로 API를 밝혀,
태그와 설명이 가득한 문서화의 세계!
숨겨진 예외도 살포시 감추고,
개발자 마음엔 안도의 미소.
한 줄 한 줄 꼼꼼히 적어,
모두가 이해하는 API의 길을 열었네.
🚀

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/main/java/com/example/gtable/store/controller/StoreController.java (1)

105-107: 검색 API 파라미터 문서화 개선 제안
@RequestParam("name") 파라미터에 @Parameter 어노테이션을 추가하여 요청 파라미터 설명을 보강하면 더욱 완전한 API 문서화를 이룰 수 있습니다.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2322326 and b5891f4.

📒 Files selected for processing (3)
  • src/main/java/com/example/gtable/global/security/exception/GlobalExceptionHandler.java (1 hunks)
  • src/main/java/com/example/gtable/store/controller/StoreController.java (7 hunks)
  • src/main/java/com/example/gtable/user/controller/UserController.java (4 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/main/java/com/example/gtable/store/controller/StoreController.java (1)
src/main/java/com/example/gtable/user/controller/UserController.java (1)
  • Tag (26-74)
🔇 Additional comments (14)
src/main/java/com/example/gtable/global/security/exception/GlobalExceptionHandler.java (2)

22-22: @hidden import 추가 확인
Swagger 문서에서 예외 핸들러를 숨기기 위해 io.swagger.v3.oas.annotations.Hidden을 올바르게 import했습니다.


26-26: GlobalExceptionHandler 클래스에 @hidden 적용
예외 처리 로직이 API 문서에 노출되지 않도록 @Hidden 애노테이션이 적절히 적용되었습니다.

src/main/java/com/example/gtable/store/controller/StoreController.java (7)

21-23: Swagger 어노테이션 import 추가
컨트롤러에 필요한 @Operation, @ApiResponse, @Tag 어노테이션이 적절히 import되었습니다.


26-26: 클래스 레벨에 @tag 추가
"Store API"라는 태그와 설명이 일관성 있게 추가되어 API 문서의 가독성이 개선되었습니다.


35-37: 주점 등록 API에 @operation@apiresponse 추가
등록 엔드포인트에 기능 요약과 응답 정보를 명확히 문서화했습니다.


50-52: 전체 주점 조회 API에 @operation@apiresponse 추가
모든 주점 리스트 조회에 대한 설명과 응답 코드가 적절히 문서화되었습니다.


63-65: 특정 주점 조회 API에 @operation@apiresponse 추가
ID 기반 조회 엔드포인트가 일관되게 문서화되었습니다.


76-78: 주점 수정 API에 @operation@apiresponse 추가
수정 엔드포인트에 요약과 응답 정보를 잘 반영했습니다.


92-94: 주점 삭제 API에 @operation@apiresponse 추가
삭제 엔드포인트의 목적과 응답 코드가 명확히 문서에 반영되었습니다.

src/main/java/com/example/gtable/user/controller/UserController.java (5)

20-22: Swagger 어노테이션 import 추가
@Operation, @ApiResponse, @Tag 어노테이션이 올바르게 import되었습니다.


26-26: 클래스 레벨에 @tag 추가
"User API" 태그로 사용자 관련 엔드포인트가 명확히 그룹화되었습니다.


36-38: 회원가입 API @operation@apiresponse 추가
관리자 회원가입 엔드포인트에 요약과 응답 코드(201)가 일치하게 문서화되었습니다.


50-52: 내 정보 조회 API @operation@apiresponse 추가
인증된 사용자 정보 조회에 대한 설명과 응답 코드(200)가 잘 반영되었습니다.


63-65: 로그인 API @operation@apiresponse 추가
관리자 로그인 엔드포인트에 대한 요약과 응답 정보가 문서에 잘 추가되었습니다.

@HyemIin HyemIin merged commit 8357688 into develop Jun 16, 2025
1 of 2 checks passed
@HyemIin HyemIin deleted the feature/#28-swagger설정 branch June 16, 2025 11:34
@HyemIin HyemIin restored the feature/#28-swagger설정 branch June 17, 2025 02:57
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.

2 participants