feat: 코스별 완주 기록 랭킹 API 추가 (Kotlin) - #248
Merged
Merged
Conversation
Redis Sorted Set + ZADD LT CH로 동시 완주 기록 중 개인 최고기록만
원자적으로 갱신. GET /api/course/{courseId}/ranking, /ranking/me 추가.
DB 커밋 이후에만 랭킹을 갱신하도록 TransactionSynchronizationManager 사용.
unam98
requested review from
RinRinPARK,
YuSuhwa-ve and
funnysunny08
as code owners
August 17, 2026 09:42
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 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 |
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.
작업 배경
변경 사항
build.gradleranking/service/RecordRankingService.ktZADD LT CH로 코스별 개인 최고기록만 원자적 갱신ranking/controller/RecordRankingController.ktGET /api/course/{courseId}/ranking,/ranking/meRecordService.createRecordTransactionSynchronizationManager.afterCommit)영향 범위
RecordService.createRecord에 훅 1곳 추가 (publicCourseId 있을 때만 동작)검증 매트릭스
기존 기록보다 빠르면 hash 인덱스에 recordId가 갱신된다기존 기록보다 느리면 hash 인덱스를 건드리지 않는다getRanking은 점수 오름차순 순서대로 순위를 매기고 recordId로 상세 정보를 조인한다getMyRanking은 0-based rank를 1-based로 변환해서 반환한다랭킹에 없는 유저면 getMyRanking은 hasRecord=false를 반환한다퍼블릭코스아이디로_정상_생성Test Plan
./gradlew test전체 통과🤖 Generated with Claude Code