From 6683b40425c9c2567a31744a0ab5feee9aff8ee1 Mon Sep 17 00:00:00 2001 From: Klaus Date: Mon, 12 Jan 2026 11:24:51 +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=BD=98=ED=85=90=EC=B8=A0=20-=20=EB=B3=B8=EC=9D=B8(?= =?UTF-8?q?=ED=81=AC=EB=A6=AC=EC=97=90=EC=9D=B4=ED=84=B0)=EB=A7=8C=20?= =?UTF-8?q?=EC=98=A4=ED=94=88=EC=98=88=EC=A0=95=20=EC=BD=98=ED=85=90?= =?UTF-8?q?=EC=B8=A0=EA=B0=80=20=EB=B3=B4=EC=9D=B4=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sodalive/explorer/ExplorerQueryRepository.kt | 13 +++++++++++++ .../vividnext/sodalive/explorer/ExplorerService.kt | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerQueryRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerQueryRepository.kt index aac21c9b..d11e69d6 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerQueryRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerQueryRepository.kt @@ -38,6 +38,7 @@ import kr.co.vividnext.sodalive.member.tag.QCreatorTag.creatorTag import kr.co.vividnext.sodalive.member.tag.QMemberCreatorTag.memberCreatorTag import org.springframework.beans.factory.annotation.Value import org.springframework.stereotype.Repository +import java.math.BigDecimal import java.time.Duration import java.time.LocalDate import java.time.LocalDateTime @@ -651,6 +652,18 @@ class ExplorerQueryRepository( .fetchFirst() } + fun getPaidContentCount(creatorId: Long): Long? { + return queryFactory + .select(audioContent.id.count()) + .from(audioContent) + .where( + audioContent.isActive.isTrue + .and(audioContent.member.id.eq(creatorId)) + .and(audioContent.price.gt(BigDecimal.ZERO)) + ) + .fetchFirst() + } + fun getOwnedContentCount(creatorId: Long, memberId: Long): Long { // 활성 주문 + 대여의 경우 유효기간 내 주문만 포함, 동일 콘텐츠 중복 구매는 1개로 카운트 return queryFactory diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerService.kt index 53551728..71d087ba 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerService.kt @@ -287,9 +287,9 @@ class ExplorerService( null } - // 크리에이터의 전체 콘텐츠 개수 + // 크리에이터의 전체 유료 콘텐츠 개수 val totalContentCount = if (isCreator) { - queryRepository.getContentCount(creatorId) ?: 0 + queryRepository.getPaidContentCount(creatorId) ?: 0 } else { 0 }