Compare commits

...

2 Commits

Author SHA1 Message Date
15d0952de8 fix(quota): 캐릭터 톡 채팅 쿼터 조회
- applyRefillOnEnterAndGetStatus를 적용하여 채팅 쿼터 조회 시 Lazy Refill 적용
2025-08-26 17:32:00 +09:00
84ebc1762b fix(quota): 채팅 쿼터 구매 시 사용 내역 문구
- 캐릭터 톡 이용권 구매
2025-08-26 17:28:06 +09:00
2 changed files with 3 additions and 9 deletions

View File

@@ -74,7 +74,7 @@ class CanService(private val repository: CanRepository) {
CanUsage.AUDITION_VOTE -> "[오디션 투표] ${it.auditionApplicant?.role?.audition?.title ?: ""}" CanUsage.AUDITION_VOTE -> "[오디션 투표] ${it.auditionApplicant?.role?.audition?.title ?: ""}"
CanUsage.CHAT_MESSAGE_PURCHASE -> "[메시지 구매] ${it.characterImage?.chatCharacter?.name ?: ""}" CanUsage.CHAT_MESSAGE_PURCHASE -> "[메시지 구매] ${it.characterImage?.chatCharacter?.name ?: ""}"
CanUsage.CHARACTER_IMAGE_PURCHASE -> "[캐릭터 이미지 구매] ${it.characterImage?.chatCharacter?.name ?: ""}" CanUsage.CHARACTER_IMAGE_PURCHASE -> "[캐릭터 이미지 구매] ${it.characterImage?.chatCharacter?.name ?: ""}"
CanUsage.CHAT_QUOTA_PURCHASE -> "AI 채팅 개수 구매" CanUsage.CHAT_QUOTA_PURCHASE -> "캐릭터 톡 이용권 구매"
} }
val createdAt = it.createdAt!! val createdAt = it.createdAt!!

View File

@@ -61,15 +61,9 @@ class ChatQuotaService(
} }
} }
@Transactional(readOnly = true) @Transactional
fun getStatus(memberId: Long): QuotaStatus { fun getStatus(memberId: Long): QuotaStatus {
val q = repo.findByMemberId(memberId) ?: return QuotaStatus( return applyRefillOnEnterAndGetStatus(memberId)
totalRemaining = FREE_BUCKET,
nextRechargeAtEpochMillis = null
)
val total = q.remainingFree + q.remainingPaid
val epoch = q.nextRechargeAt?.atZone(ZoneId.systemDefault())?.toInstant()?.toEpochMilli()
return QuotaStatus(totalRemaining = total, nextRechargeAtEpochMillis = epoch)
} }
@Transactional @Transactional