-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: swagger 어노테이션 등록 #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "feature/#28-swagger\uC218\uC815"
Conversation
- 각 컨트롤러에 swagger 어노테이션 등록
Walkthrough이번 변경에서는 여러 컨트롤러 클래스에 OpenAPI(Swagger) 어노테이션이 추가되어 API 문서화가 강화되었으며, 일부 엔드포인트의 URL 경로와 보안 설정이 수정되었습니다. 비즈니스 로직에는 영향이 없으며, 주로 문서화 및 접근 경로 관련 변경입니다. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API_Gateway
participant Controller
Client->>API_Gateway: POST /api/bookmarks/create/{storeId}
API_Gateway->>Controller: createBookmark(storeId, user)
Controller-->>API_Gateway: Response
API_Gateway-->>Client: Response
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
src/main/java/com/example/gtable/global/config/SecurityConfig.java (1)
55-63:⚠️ /admin/**엔드포인트를 모두permitAll()로 노출하면 관리자 기능이 무방비 상태가 됩니다
/admin/stores/**,/admin/menus/**,/admin/users/**를 인증 없이 허용하면서
기존에 일반 사용자가 접근해야 했던/api/users/signup,/api/users/login등은 허용 목록에서 빠졌습니다.결과적으로
- 관리자 전용 기능이 아무 제약 없이 공개되고,
- 회원가입·로그인 API 는 오히려 인증이 필요한 상태로 잠겨 서비스 진입 자체가 불가능해질 수 있습니다.
의도된 정책이 아니라면 다음과 같이 조정해 주세요.
- "/admin/stores/**", - "/admin/menus/**", - "/admin/users/**", + "/api/users/signup", + "/api/users/login", + "/oauth2/authorization/kakao", + "/login/oauth2/code/**",그리고 관리자 영역은
hasRole("ADMIN")또는 별도SecurityMatcher로 보호하는 편이 안전합니다.필요하다면
authorizeHttpRequests재구성을 위한 예시 코드를 드릴 수 있습니다. 말씀만 주세요!
🧹 Nitpick comments (5)
src/main/java/com/example/gtable/menu/controller/MenuController.java (1)
17-20: Swagger 어노테이션 추가 👍명세가 한눈에 들어와서 유지보수성이 좋아졌습니다.
추가적인 응답 예시(@ApiResponse→@ApiResponseswithcontent) 도 향후 고려해 보시면 좋겠습니다.src/main/java/com/example/gtable/storeImage/controller/StoreImageController.java (1)
19-24:"주점 이미록 API"오타 수정 필요
이미록➡️이미지가 맞는 듯합니다 😊-@Tag(name = "StoreImage API", description = "주점 이미록 API") +@Tag(name = "StoreImage API", description = "주점 이미지 API")src/main/java/com/example/gtable/menuImage/controller/MenuImageController.java (3)
17-19: Swagger 어노테이션 임포트 그룹화/정렬 제안
io.swagger.v3.oas.annotations.*임포트를 서로 인접하게 배치하고, Spring 프레임워크 임포트와 빈 줄로 구분해주면 가독성이 향상됩니다.
21-21: @tag 애노테이션의 네이밍 일관성 검토
name = "Menu Image API"와description = "메뉴 이미지 API"중 언어(영문/한글) 사용이 혼재되어 있습니다. 프로젝트 전반의 태그 명칭 컨벤션(영문 vs. 한글)을 따라 통일하는 것을 권장드립니다.
30-32: 업로드 API 설명 수정 제안
description = "특정 주점에 대한 메뉴 이미지 업로드"는 메뉴 단위가 아닌 주점(점포) 단위로 표현되어 있습니다. 아래와 같이 명확히 변경하면 좋겠습니다:@Operation(summary = "메뉴 이미지 업로드", description = "특정 메뉴에 대한 이미지 업로드") @ApiResponse(responseCode = "201", description = "메뉴 이미지가 성공적으로 업로드됨")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
src/main/java/com/example/gtable/bookmark/controller/BookmarkController.java(1 hunks)src/main/java/com/example/gtable/global/config/SecurityConfig.java(1 hunks)src/main/java/com/example/gtable/menu/controller/MenuController.java(3 hunks)src/main/java/com/example/gtable/menuImage/controller/MenuImageController.java(3 hunks)src/main/java/com/example/gtable/store/controller/StoreController.java(7 hunks)src/main/java/com/example/gtable/storeImage/controller/StoreImageController.java(3 hunks)
🔇 Additional comments (2)
src/main/java/com/example/gtable/bookmark/controller/BookmarkController.java (1)
29-33: 경로 변경/create/{storeId}→ 기존 클라이언트 호환성 확인 필요엔드포인트가
/{storeId}에서/create/{storeId}로 바뀌었습니다.
배포 전에 모바일·프론트엔드 쪽에서 호출 URL 을 모두 수정했는지 꼭 확인해 주세요.
API 버전 관리(예:/v1/…)가 없다면 구형 클라이언트는 404 를 받게 됩니다.src/main/java/com/example/gtable/store/controller/StoreController.java (1)
21-27: 문서화 품질 향상 👍
@Tag및 각 메서드의@Operation추가는 REST 명세 일관성 확보에 큰 도움이 됩니다.
추가로@Parameter(hidden = true)로 불필요한 파라미터 노출을 숨길 수도 있으니 참고해주세요.
src/main/java/com/example/gtable/storeImage/controller/StoreImageController.java
Show resolved
Hide resolved
src/main/java/com/example/gtable/menuImage/controller/MenuImageController.java
Show resolved
Hide resolved
- 삭제 시 responsecode 수정
작업 요약
Issue Link
#28
문제점 및 어려움
해결 방안
Reference
Summary by CodeRabbit
Documentation
Bug Fixes
Chores