[feat] AI 팀장 대화 일일 잔여 횟수 조회 API (GET /users/me/ai-quota) - #321
Merged
Conversation
FE 가 일일 한도 소진 전에 잔여 횟수를 표시할 수 있도록, 증가 없이(read-only)
현재 사용량/잔여/리셋 잔여시간을 조회하는 엔드포인트를 추가한다.
- RateLimiter.peek(key): 카운터 증가 없이 스냅샷 조회(default=정보없음, Redis 가 GET+PTTL 로 구현).
- RateLimitSnapshot(count, timeToReset), AiConversationQuotaView(dailyLimit, used, remaining, resetSeconds) 추가.
- RateLimitGuard.aiConversationQuota(userId, plan): 플랜별 일일 한도 + 현재 사용량 스냅샷.
- AuthController: GET /api/v1/users/me/ai-quota → {plan, dailyLimit, used, remaining, resetSeconds}.
레이트리밋 미구성 시 dailyLimit/remaining=-1(무제한).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
목적
FE 가 AI 팀장 채팅 일일 한도 소진 전에 잔여 횟수를 표시하기 위한 read-only 조회 API.
변경
RateLimiter.peek(key): 카운터 증가 없이 현재 사용량/리셋 잔여시간 조회(default=정보없음, RedisRateLimiter 가 GET+PTTL 로 구현). 인터페이스는 default 로 함수형 유지.RateLimitSnapshot,AiConversationQuotaView추가.RateLimitGuard.aiConversationQuota(userId, plan)신설.GET /api/v1/users/me/ai-quota→{plan, dailyLimit, used, remaining, resetSeconds}. 레이트리밋 미구성 시-1(무제한).검증
로컬
./gradlew check build전체 통과. 신규 테스트: 증가 없이 사용량 보고.🤖 Generated with Claude Code