From c494ddcf20e3f9aee698060e6c7eb982edef9559 Mon Sep 17 00:00:00 2001 From: Klaus Date: Mon, 5 Jan 2026 14:23:28 +0900 Subject: [PATCH] =?UTF-8?q?=ED=81=AC=EB=A6=AC=EC=97=90=EC=9D=B4=ED=84=B0?= =?UTF-8?q?=20=EC=B1=84=EB=84=90=EC=9D=98=20=ED=9B=84=EC=9B=90=EB=9E=AD?= =?UTF-8?q?=ED=82=B9=EC=97=90=20=EC=9D=B4=EB=AF=B8=EC=A7=80=EC=97=90=20ima?= =?UTF-8?q?geHost=EB=A5=BC=20=EC=97=B0=EA=B2=B0=ED=95=98=EC=97=AC=20?= =?UTF-8?q?=EC=A0=95=EC=83=81=EC=A0=81=EC=9C=BC=EB=A1=9C=20=ED=91=9C?= =?UTF-8?q?=EC=8B=9C=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../profile/CreatorDonationRankingQueryRepository.kt | 11 ----------- .../explorer/profile/CreatorDonationRankingService.kt | 10 +++++++--- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/CreatorDonationRankingQueryRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/CreatorDonationRankingQueryRepository.kt index 8929bce5..c17abe2d 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/CreatorDonationRankingQueryRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/CreatorDonationRankingQueryRepository.kt @@ -8,10 +8,6 @@ import kr.co.vividnext.sodalive.can.use.QUseCan.useCan import kr.co.vividnext.sodalive.can.use.QUseCanCalculate.useCanCalculate import kr.co.vividnext.sodalive.member.QMember.member import org.springframework.stereotype.Repository -import java.time.DayOfWeek -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.temporal.TemporalAdjusters @Repository class CreatorDonationRankingQueryRepository(private val queryFactory: JPAQueryFactory) { @@ -19,12 +15,6 @@ class CreatorDonationRankingQueryRepository(private val queryFactory: JPAQueryFa creatorId: Long, limit: Long ): List { - val now = LocalDateTime.now() - val lastMonday = now.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)) - .minusWeeks(1) - .with(LocalTime.MIN) - val lastSunday = lastMonday.plusDays(6).with(LocalTime.MAX) - val donationCan = useCan.rewardCan.add(useCan.can).sum() return queryFactory .select( @@ -47,7 +37,6 @@ class CreatorDonationRankingQueryRepository(private val queryFactory: JPAQueryFa .or(useCan.canUsage.eq(CanUsage.SPIN_ROULETTE)) .or(useCan.canUsage.eq(CanUsage.LIVE)) ) - .and(useCan.createdAt.between(lastMonday, lastSunday)) ) .offset(0) .limit(limit) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/CreatorDonationRankingService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/CreatorDonationRankingService.kt index cbf51577..b7f5bee5 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/CreatorDonationRankingService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/profile/CreatorDonationRankingService.kt @@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.explorer.profile import kr.co.vividnext.sodalive.explorer.MemberDonationRankingListResponse import kr.co.vividnext.sodalive.explorer.MemberDonationRankingResponse +import org.springframework.beans.factory.annotation.Value import org.springframework.data.redis.core.RedisTemplate import org.springframework.stereotype.Service import java.time.DayOfWeek @@ -14,14 +15,17 @@ import java.time.temporal.TemporalAdjusters @Service class CreatorDonationRankingService( private val repository: CreatorDonationRankingQueryRepository, - private val redisTemplate: RedisTemplate + private val redisTemplate: RedisTemplate, + + @Value("\${cloud.aws.cloud-front.host}") + private val imageHost: String ) { fun getMemberDonationRanking( creatorId: Long, limit: Long, withDonationCan: Boolean ): List { - val cacheKey = "creator_donation_ranking:$creatorId:$limit:$withDonationCan" + val cacheKey = "creator_donation_ranking_v2:$creatorId:$limit:$withDonationCan" val cachedData = redisTemplate.opsForValue().get(cacheKey) as? MemberDonationRankingListResponse if (cachedData != null) { return cachedData.rankings @@ -33,7 +37,7 @@ class CreatorDonationRankingService( MemberDonationRankingResponse( it.memberId, it.nickname, - it.profileImage, + "$imageHost/${it.profileImage}", if (withDonationCan) it.donationCan else 0 ) }