-
Notifications
You must be signed in to change notification settings - Fork 0
Feature: 주점 조회 public code 사용하도록 리팩토링 #297
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
Conversation
|
Caution Review failedThe pull request is closed. Walkthrough컨트롤러와 서비스 시그니처를 매장 식별자 Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client as 클라이언트
participant Controller as StoreController
participant Service as StoreService
participant Impl as StoreServiceImpl
participant Repo as StoreRepository
participant Aux as Dept/Bookmark/Image/Redis
Client->>Controller: GET /stores/{publicCode}
Controller->>Service: getStoreByPublicCode(publicCode, user)
Service->>Impl: 실행 위임(publicCode, user)
Impl->>Repo: findByPublicCodeAndDeletedFalse(publicCode)
Repo-->>Impl: Store 엔티티
Note right of Impl: storeId = store.getStoreId() 계산
Impl->>Aux: 부서/북마크/이미지/대기열 조회 (storeId, user)
Aux-->>Impl: 데이터 집계
Impl-->>Service: StoreDetailReadResponse 반환
Service-->>Controller: 응답 전달
Controller-->>Client: 200 OK (ApiUtils.success)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (5)
✨ Finishing Touches
🧪 Generate unit tests
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. CodeRabbit Commands (Invoked using PR/Issue comments)Type 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: 4
🧹 Nitpick comments (3)
nowait-app-user-api/src/main/java/com/nowait/applicationuser/store/service/StoreServiceImpl.java (2)
153-153: 불필요한 세미콜론 제거빈 문장 생성(무해하지만 불필요). 정리 권장.
- Long storeId = store.getStoreId();; + Long storeId = store.getStoreId();
150-150: DB 제약/인덱스 확인 권장publicCode 단건 조회를 전제로 한다면 컬럼에 유니크 제약 및 인덱스 존재 여부를 확인/추가해 주세요.
nowait-app-user-api/src/main/java/com/nowait/applicationuser/store/controller/StoreController.java (1)
50-50: API 문서 텍스트 정합성(ID → public code)스웨거 문구를 public code 기준으로 수정해 주세요.
- @Operation(summary = "주점 ID로 주점 상세 조회", description = "특정 주점을 ID로 조회합니다.") + @Operation(summary = "public code로 주점 상세 조회", description = "특정 주점을 public code로 조회합니다.")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
nowait-app-user-api/src/main/java/com/nowait/applicationuser/store/controller/StoreController.java(1 hunks)nowait-app-user-api/src/main/java/com/nowait/applicationuser/store/dto/StorePageReadResponse.java(2 hunks)nowait-app-user-api/src/main/java/com/nowait/applicationuser/store/service/StoreService.java(1 hunks)nowait-app-user-api/src/main/java/com/nowait/applicationuser/store/service/StoreServiceImpl.java(1 hunks)
🔇 Additional comments (1)
nowait-app-user-api/src/main/java/com/nowait/applicationuser/store/dto/StorePageReadResponse.java (1)
18-18: publicCode 필드 추가 및 매핑 LGTMDTO에 publicCode 포함과 fromEntity 매핑이 요구사항과 일치합니다.
Also applies to: 49-49
| } | ||
|
|
||
| @GetMapping("/{storeId}") | ||
| @GetMapping("/{publicCode}") |
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.
🛠️ Refactor suggestion
publicCode 전환 마무리: 경로 패턴 제한 + 메서드/호출 네이밍 정리
- 경로 변수에 허용 패턴을 명시해 라우팅 모호성 방지.
- 메서드/서비스 호출 명도 publicCode에 맞춰 통일.
- @GetMapping("/{publicCode}")
+ @GetMapping("/{publicCode:[A-Za-z0-9_-]+}")
@@
- public ResponseEntity<?> getStoreById(@PathVariable String publicCode, @AuthenticationPrincipal CustomOAuth2User customOAuth2User) {
+ public ResponseEntity<?> getStoreByPublicCode(@PathVariable String publicCode, @AuthenticationPrincipal CustomOAuth2User customOAuth2User) {
@@
- storeService.getStoreByStoreId(publicCode, customOAuth2User)
+ storeService.getStoreByPublicCode(publicCode, customOAuth2User)Also applies to: 52-52, 57-57
🤖 Prompt for AI Agents
In
nowait-app-user-api/src/main/java/com/nowait/applicationuser/store/controller/StoreController.java
around lines 49, 52 and 57, the @GetMapping path variables lack an explicit
allowed pattern and the controller/service method names still reference the old
identifier; update the route annotations to restrict the publicCode path
variable to the intended pattern (e.g., alphanumerics and hyphen) to avoid
routing ambiguity, and rename the controller methods and any service calls to
consistently use "publicCode" in their method names/parameters so the API and
service layer reflect the new publicCode semantics.
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.
나중에 보완할게. 이슈 등록 부탁해
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.
🧩 Analysis chain
@Jjiggu 네, 이슈를 등록해드리겠습니다.
🏁 Script executed:
#!/bin/bash
# Create a GitHub issue for the publicCode refactoring improvements
gh issue create \
--title "주점 조회 API publicCode 패턴 제한 및 메서드명 일관성 개선" \
--body "## 배경
PR #297에서 주점 조회가 storeId에서 publicCode를 사용하도록 리팩토링되었으나, 추가 개선사항이 있습니다.
## 개선 필요사항
### 1. 경로 변수 패턴 제한
- publicCode 경로 변수에 허용 패턴을 명시하여 라우팅 모호성 방지
- 예: \`@GetMapping(\"/{publicCode:[A-Za-z0-9_-]+}\")\`
### 2. 메서드명 일관성
- 컨트롤러 메서드명을 publicCode 의미에 맞게 변경
- 서비스 호출 메서드명도 일관성 있게 수정
- \`getStoreById\` → \`getStoreByPublicCode\`
- \`getStoreByStoreId\` → \`getStoreByPublicCode\`
## 참고 링크
- 관련 PR: https://github.com/GTable/NoWait_BE_MultiModule/pull/297
- 코드리뷰 코멘트: https://github.com/GTable/NoWait_BE_MultiModule/pull/297#discussion_r2309702381
- 요청자: @Jjiggu
## 파일 범위
- \`nowait-app-user-api/src/main/java/com/nowait/applicationuser/store/controller/StoreController.java\`
- \`nowait-app-user-api/src/main/java/com/nowait/applicationuser/store/service/StoreService.java\`
- \`nowait-app-user-api/src/main/java/com/nowait/applicationuser/store/service/StoreServiceImpl.java\`" \
--assignee Jjiggu
Length of output: 1015
@Jjiggu 이슈가 성공적으로 등록되었습니다!
📋 이슈 #298: 주점 조회 API publicCode 패턴 제한 및 메서드명 일관성 개선
publicCode 패턴 제한 및 메서드명 일관성 개선사항들이 이슈로 정리되어 나중에 작업하실 수 있도록 준비되었습니다. 현재 PR은 그대로 진행하시면 됩니다! 🚀
🐰
/| /|
( ✌️ )|
| |
작업 요약
Issue Link
#290
문제점 및 어려움
해결 방안
Reference
Summary by CodeRabbit
신규 기능
버그 수정
리팩터링