-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 사진 생성 제한 및 최대 사진 수 수정 #111
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
WalkthroughcreateAlbum이 사용자 주간 생성 수(최근 7일)를 계산해 AlbumValidator.validateAlbumCreation(createdThisWeek, request)를 호출하도록 변경되고, AlbumMapper에서 새 앯범의 최대 사진 수가 300→2000으로 상향되었습니다. Changes
Sequence Diagram(s)(생성/검증 흐름이 단순하여 시퀀스 다이어그램은 생략합니다.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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. 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.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/java/com/cheeeese/album/application/AlbumService.java (1)
274-280: 시간 범위 계산 오류로 인한 잘못된 주간 제한종료 시간 계산에
LocalTime.now()를 사용하여 의도한 것보다 긴 기간을 조회하고 있습니다.문제점:
- 현재 구현:
다음 주 월요일 + 현재 시각까지 조회- 예시: 금요일 오후 2시에 실행 시
- 시작: 이번 주 월요일 00:00:00
- 종료: 다음 주 월요일 14:00:00
- 실제 조회 범위: 8일 14시간 (7일이 아님)
영향:
- 사용자가 이번 주에 생성한 앨범 수를 정확히 계산하지 못함
- 주간 제한이 의도대로 작동하지 않을 수 있음
🔎 제안하는 수정 방안
private long countUserAlbumsCreatedThisWeek(User user) { return albumRepository.countByUserAndCreatedAtBetween( user.getId(), LocalDate.now().with(DayOfWeek.MONDAY).atTime(LocalTime.MIN), - LocalDate.now().with(DayOfWeek.MONDAY).plusWeeks(1).atTime(LocalTime.now()) + LocalDate.now().with(DayOfWeek.MONDAY).plusWeeks(1).atTime(LocalTime.MIN) ); }또는 더 명확하게:
private long countUserAlbumsCreatedThisWeek(User user) { + LocalDateTime startOfWeek = LocalDate.now().with(DayOfWeek.MONDAY).atTime(LocalTime.MIN); + LocalDateTime startOfNextWeek = startOfWeek.plusWeeks(1); return albumRepository.countByUserAndCreatedAtBetween( user.getId(), - LocalDate.now().with(DayOfWeek.MONDAY).atTime(LocalTime.MIN), - LocalDate.now().with(DayOfWeek.MONDAY).plusWeeks(1).atTime(LocalTime.now()) + startOfWeek, + startOfNextWeek ); }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/main/java/com/cheeeese/album/application/AlbumService.javasrc/main/java/com/cheeeese/album/application/validator/AlbumValidator.javasrc/main/java/com/cheeeese/album/infrastructure/mapper/AlbumMapper.java
🔇 Additional comments (3)
src/main/java/com/cheeeese/album/infrastructure/mapper/AlbumMapper.java (1)
37-37: 변경사항 확인 완료앨범당 최대 사진 개수를 2000장으로 증가시킨 변경이 PR 목표와 일치합니다.
src/main/java/com/cheeeese/album/application/validator/AlbumValidator.java (1)
29-29: 주간 앨범 생성 제한 로직 검증 완료메서드 시그니처 변경과 주간 생성 제한 검증 로직(
createdThisWeek >= 3)이 올바르게 구현되었습니다. 예외 처리도 적절합니다.Also applies to: 50-52
src/main/java/com/cheeeese/album/application/AlbumService.java (1)
74-76: 검증 로직 통합 확인주간 앨범 생성 개수를 계산하고 검증자에 전달하는 로직이 올바르게 구현되었습니다. 단,
countUserAlbumsCreatedThisWeek메서드의 정확성에 의존합니다.
dahyun24
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.
구웃!
🔗 연관된 이슈
🚀 변경 유형
📝 작업 내용
📸 스크린샷
💬 리뷰 요구사항
📜 리뷰 규칙
Reviewer는 아래 P5 Rule을 참고하여 리뷰를 진행합니다.
P5 Rule을 통해 Reviewer는 Reviewee에게 리뷰의 의도를 보다 정확히 전달할 수 있습니다.
Summary by CodeRabbit
릴리스 노트
새 기능
버그 수정
✏️ Tip: You can customize this high-level summary in your review settings.