-
Notifications
You must be signed in to change notification settings - Fork 0
Issue: (#138) 기념일 상세 조회 #139
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
Walkthrough기념일 상세 정보를 조회하는 기능이 추가되었습니다. 새로운 DTO와 API 엔드포인트가 도입되었으며, 인증된 사용자가 자신의 커플에 속한 기념일만 조회할 수 있도록 검증 로직이 포함되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Controller
participant Facade
participant Service
User->>Controller: GET /anniversaries/{anniversaryId}
Controller->>Facade: get(customUserDetails, anniversaryId)
Facade->>Service: getById(anniversaryId)
Service-->>Facade: Anniversary
Facade->>Facade: 커플 ID 일치 여부 확인
Facade-->>Controller: AnniversaryDetailResponse
Controller-->>User: ApiResponse<AnniversaryDetailResponse>
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
✨ 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
Documentation and Community
|
6a990e0 to
ef3a45a
Compare
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
🧹 Nitpick comments (1)
src/main/kotlin/gomushin/backend/couple/domain/service/CoupleConnectService.kt (1)
19-21: 사용되지 않는 상수 제거 필요
COUPLE_CODE_DURATION상수가 더 이상 사용되지 않으므로 제거해야 합니다.다음과 같이 사용되지 않는 상수를 제거하세요:
- companion object { - private val COUPLE_CODE_DURATION = Duration.ofMinutes(60) - private const val COUPLE_CODE_PREFIX = "COUPLE_CODE:" - } + companion object { + private const val COUPLE_CODE_PREFIX = "COUPLE_CODE:" + }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.github/workflows/deploy.yml(1 hunks)src/main/kotlin/gomushin/backend/couple/domain/service/CoupleConnectService.kt(1 hunks)src/main/kotlin/gomushin/backend/couple/dto/response/AnniversaryDetailResponse.kt(1 hunks)src/main/kotlin/gomushin/backend/couple/facade/AnniversaryFacade.kt(2 hunks)src/main/kotlin/gomushin/backend/couple/presentation/AnniversaryController.kt(3 hunks)
🔇 Additional comments (5)
src/main/kotlin/gomushin/backend/couple/dto/response/AnniversaryDetailResponse.kt (1)
6-20: 잘 구현된 응답 DTO입니다.코틀린 관례를 잘 따르고 있으며, 불변 속성과 팩토리 메서드를 적절히 사용했습니다. LocalDate 타입 사용도 적절합니다.
src/main/kotlin/gomushin/backend/couple/facade/AnniversaryFacade.kt (1)
37-43: 기념일 상세 조회 메서드가 잘 구현되었습니다.권한 검증 로직이 적절히 구현되어 있고, 다른 메서드들과 일관된 패턴을 따르고 있습니다. 에러 처리도 명확합니다.
src/main/kotlin/gomushin/backend/couple/presentation/AnniversaryController.kt (3)
7-7: 새로운 DTO import 추가 승인기념일 상세 조회 기능을 위한
AnniversaryDetailResponseimport가 적절하게 추가되었습니다.
19-19: Tag 어노테이션 개선 승인컨트롤러의 Tag를 "기념일 생성"에서 "기념일"로 변경한 것은 현재 컨트롤러가 생성뿐만 아니라 조회, 삭제 등 다양한 기념일 관련 기능을 제공하므로 더 적절한 변경입니다.
79-91: 기념일 상세 조회 엔드포인트 구현 승인새로운 GET 엔드포인트가 잘 구현되었습니다:
- REST API 규칙을 준수하여 GET 메서드 사용
- 적절한 HTTP 상태 코드 (200 OK) 설정
- 인증된 사용자 정보와 경로 변수를 올바르게 받음
- 일관된 응답 형식 (ApiResponse 래핑) 사용
- facade 패턴을 통한 비즈니스 로직 위임
다른 메서드들과 동일한 패턴을 따르고 있어 코드 일관성이 유지되고 있습니다.
.github/workflows/deploy.yml
Outdated
| pull_request: | ||
| branches: [ main ] |
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.
💡 Verification agent
🧩 Analysis chain
배포 워크플로우가 PR에서도 트리거되는지 확인 필요
현재 설정으로는 main 브랜치로의 PR이 생성될 때마다 배포가 실행됩니다. 이는 의도된 동작인지 확인이 필요합니다. 일반적으로는 PR에서는 테스트만 실행하고, main 브랜치로 머지될 때만 배포하는 것이 좋습니다.
다음 스크립트로 다른 프로젝트의 워크플로우 패턴을 확인해보세요:
🏁 Script executed:
#!/bin/bash
# Description: Check if other workflow files separate CI and deployment
# Expected: Find patterns where CI runs on PR and deployment only on push to main
fd -e yml -e yaml . .github/workflows/ --exec grep -l "pull_request\|push" {} \; | head -5Length of output: 124
배포 워크플로우 PR 트리거 제거 필요
현재 .github/workflows/deploy.yml 에서 pull_request 이벤트가 설정되어 있어, main 브랜치로 PR이 생성될 때마다 배포가 실행됩니다. PR 단계에서는 테스트만 수행하고, main 브랜치로 머지된 경우에만 배포하도록 수정이 필요합니다.
- 수정 위치:
.github/workflows/deploy.yml(lines 6–7) - 제안 변경:
-on:
- pull_request:
- branches: [ main ]
+on:
+ push:
+ branches: [ main ]※ CI와 배포를 완전히 분리하려면 별도의 .github/workflows/ci.yml 파일을 만들어 PR 트리거로 테스트만 실행하고, deploy.yml 은 위와 같이 push 트리거만 사용하도록 구성하세요.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| pull_request: | |
| branches: [ main ] | |
| on: | |
| push: | |
| branches: [ main ] |
🤖 Prompt for AI Agents
In .github/workflows/deploy.yml around lines 6 to 7, the deployment workflow is
currently triggered on pull_request events to the main branch, causing
deployments on PR creation. To fix this, remove the pull_request trigger and
configure the workflow to trigger only on push events to the main branch. This
ensures deployments occur only after merging to main. Additionally, consider
creating a separate CI workflow file triggered on pull_request for running
tests.
| val coupleCode = CoupleCodeGeneratorUtil.generateCoupleCode() | ||
| val key = getCoupleCodeKey(coupleCode) | ||
| redisTemplate.opsForValue().set(key, userId.toString(), COUPLE_CODE_DURATION) | ||
| redisTemplate.opsForValue().set(key, userId.toString()) |
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.
커플 코드의 무제한 저장으로 인한 잠재적 문제
커플 코드에 만료 시간을 설정하지 않으면 다음과 같은 문제가 발생할 수 있습니다:
- Redis 메모리 사용량이 계속 증가
- 오래된 커플 코드가 무기한 사용 가능
- 보안상 위험 (코드 유출 시 영구적으로 유효)
만료 시간을 다시 설정하거나 다른 정리 메커니즘을 구현하는 것을 권장합니다:
- redisTemplate.opsForValue().set(key, userId.toString())
+ redisTemplate.opsForValue().set(key, userId.toString(), COUPLE_CODE_DURATION)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| redisTemplate.opsForValue().set(key, userId.toString()) | |
| redisTemplate.opsForValue().set(key, userId.toString(), COUPLE_CODE_DURATION) |
🤖 Prompt for AI Agents
In
src/main/kotlin/gomushin/backend/couple/domain/service/CoupleConnectService.kt
at line 27, the Redis set operation for the couple code does not specify an
expiration time, which can cause memory bloat and security risks. Modify the
code to set an appropriate expiration time on the Redis key when storing the
couple code, using RedisTemplate's set method overload that accepts a timeout
parameter or by explicitly setting the expiration after the set operation.
ef3a45a to
c481ef5
Compare
kimyeoungrok
left a comment
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.
good
✅ PR 유형
어떤 변경 사항이 있었나요?
📝 작업 내용
✏️ 관련 이슈
🎸 기타 사항 or 추가 코멘트
Summary by CodeRabbit