feat(family) : monthly api의 redis 실시간 처리 추가#286
Conversation
|
정책 위반: main에는 dev에서만 PR이 가능합니다. 이 PR은 자동으로 닫습니다. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR enhances family shared pool monthly usage reporting by introducing line-level tracking with Changes
Sequence DiagramsequenceDiagram
participant Client
participant Service as FamilySharedPoolsService
participant Mapper as MyBatis Mapper
participant DB as Database
participant KeyFactory as TrafficRedisKeyFactory
participant Cache as TrafficQuotaCacheService
participant Redis as Redis
Client->>Service: getFamilyMonthlySharedUsageTotal()
Service->>Mapper: selectFamilyMonthlySharedUsageByLine
Mapper->>DB: SELECT monthlySharedPoolUsage, lineId
DB-->>Mapper: Member usage records
Mapper-->>Service: List<MemberUsageDto>
loop For each member
Service->>Service: adjustMonthlySharedUsage(dbUsage, lineId)
Service->>Service: normalizeNonNegative(dbUsage)
alt Redis available
Service->>KeyFactory: Generate monthlySharedUsageKey(lineId, yearMonth)
KeyFactory-->>Service: Redis key
Service->>Cache: readValueOrDefault(key, 0L)
Cache->>Redis: GET key
Redis-->>Cache: value or null
Cache-->>Service: Parsed long value
Service->>Service: max(normalizedDbUsage, redisUsage)
else Redis unavailable
Service->>Service: Use normalizedDbUsage
end
end
Service-->>Client: SharedPoolMonthlyUsageResDto with max values
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip You can validate your CodeRabbit configuration file in your editor.If your editor has YAML language server, you can enable auto-completion and validation by adding |
|
정책 위반: main에는 dev에서만 PR이 가능합니다. 이 PR은 자동으로 닫습니다. |
개요
monthly api의 redis 실시간 처리 추가
관련 BackLog
Resolves: (Backlog Number, ...)
PR 유형
PR Checklist
Summary by CodeRabbit
Improvements
Tests