크리에이터 콘텐츠 - 본인(크리에이터)만 오픈예정 콘텐츠가 보이도록 설정 변경

This commit is contained in:
2026-01-12 11:24:51 +09:00
parent 435010d523
commit 6683b40425
2 changed files with 15 additions and 2 deletions

View File

@@ -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

View File

@@ -287,9 +287,9 @@ class ExplorerService(
null
}
// 크리에이터의 전체 콘텐츠 개수
// 크리에이터의 전체 유료 콘텐츠 개수
val totalContentCount = if (isCreator) {
queryRepository.getContentCount(creatorId) ?: 0
queryRepository.getPaidContentCount(creatorId) ?: 0
} else {
0
}