[WBS - 104 ~ 107]통계 API 구현 - #43
Merged
Merged
Conversation
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Walkthrough부스 및 행사 통계 조회 기능을 추가했다. 네 개의 GET API가 시간대별 통계, 전날 통계, 인기 부스, 행사 운영 요약을 제공한다. 서비스는 집계 조회와 인증·역할 기반 접근 권한을 처리한다. Changes부스 통계 조회
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant BoothStatisticsController
participant BoothStatisticsService
participant BoothHourlyStatisticsRepository
Client->>BoothStatisticsController: GET 통계 조회 요청
BoothStatisticsController->>BoothStatisticsController: 날짜 기본값 또는 기간 검증
BoothStatisticsController->>BoothStatisticsService: 파라미터와 인증 회원 전달
BoothStatisticsService->>BoothStatisticsService: 인증·리소스·역할 권한 검증
BoothStatisticsService->>BoothHourlyStatisticsRepository: 시간대별 또는 기간별 집계 조회
BoothHourlyStatisticsRepository-->>BoothStatisticsService: 통계 집계 결과 반환
BoothStatisticsService-->>BoothStatisticsController: 통계 응답 DTO 반환
BoothStatisticsController-->>Client: ApiResponse.success 응답
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@BE/src/main/java/com/min/edu/booth/controller/BoothStatisticsController.java`:
- Around line 50-51: BoothStatisticsController의
getPopularBooths(BE/src/main/java/com/min/edu/booth/controller/BoothStatisticsController.java:50-51)와
getEventOverview(BE/src/main/java/com/min/edu/booth/controller/BoothStatisticsController.java:62-63)
호출 전에 공통 기간 검증을 적용하세요. from.isAfter(to)인 경우 두 API 모두 400 응답을 반환하도록 공통 검증 메서드 또는
요청 검증 객체를 사용하고, 정상적인 기간은 기존 서비스 호출로 계속 전달하세요.
In
`@BE/src/main/java/com/min/edu/booth/repository/BoothHourlyStatisticsRepository.java`:
- Around line 21-29: Update the query used by BoothHourlyStatisticsRepository to
add a deterministic secondary sort by bhs.boothId ascending after the
reservation-count aggregate ordering, preserving the existing descending ranking
criterion.
In `@BE/src/main/java/com/min/edu/booth/service/BoothStatisticsService.java`:
- Around line 229-242: Update the summary construction around aggregations and
boothCodeMap so every booth in boothCodeMap produces a
BoothStatisticsDtos.BoothStatSummary, including booths without matching
aggregation rows. Reuse matching aggregation values when present; otherwise set
total reservation, no-show, and QR scan counts to 0, while preserving the
existing booth ID and code mapping.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: f55e4c97-b604-4687-8656-df8d76c591ac
📒 Files selected for processing (6)
BE/src/main/java/com/min/edu/booth/controller/BoothStatisticsController.javaBE/src/main/java/com/min/edu/booth/dto/BoothStatisticsDtos.javaBE/src/main/java/com/min/edu/booth/repository/BoothHourlyStatisticsRepository.javaBE/src/main/java/com/min/edu/booth/repository/BoothRepository.javaBE/src/main/java/com/min/edu/booth/repository/BoothStatAggregation.javaBE/src/main/java/com/min/edu/booth/service/BoothStatisticsService.java
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📄 작업 내용
구현 내용
부스 및 행사 운영 통계 API 4개를 구현했습니다.
STAT-API-001
GET /booths/{boothId}/statistics/hourlydate파라미터 미입력 시 오늘 날짜 기본 사용STAT-API-002
GET /booths/{boothId}/statistics/previous-daySTAT-API-003
GET /events/{eventId}/statistics/popular-boothsSTAT-API-004
GET /events/{eventId}/statistics/overview주요 설계 사항
BoothStatAggregationProjection으로 JPQL 집계 쿼리 결과를 타입 안전하게 처리aggregateByBoothIdsAndDateBetween()쿼리를 STAT-API-003·004에서 공통 재사용🔗 관련 이슈
Closes #
☑️ 체크리스트
💬 리뷰어에게
booth_hourly_statistics테이블에 직접 INSERT 되어 있어야 테스트 가능합니다. (현재 집계 스케줄러 미구현)from,to는 필수 파라미터입니다. 기본값 정책이 필요하다면 논의 부탁드립니다.Summary by CodeRabbit
새 기능
개선