캔 사용 시 국가 코드 기록 기능 추가 #374
@@ -38,6 +38,7 @@ import kr.co.vividnext.sodalive.member.tag.QCreatorTag.creatorTag
|
|||||||
import kr.co.vividnext.sodalive.member.tag.QMemberCreatorTag.memberCreatorTag
|
import kr.co.vividnext.sodalive.member.tag.QMemberCreatorTag.memberCreatorTag
|
||||||
import org.springframework.beans.factory.annotation.Value
|
import org.springframework.beans.factory.annotation.Value
|
||||||
import org.springframework.stereotype.Repository
|
import org.springframework.stereotype.Repository
|
||||||
|
import java.math.BigDecimal
|
||||||
import java.time.Duration
|
import java.time.Duration
|
||||||
import java.time.LocalDate
|
import java.time.LocalDate
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
@@ -651,6 +652,18 @@ class ExplorerQueryRepository(
|
|||||||
.fetchFirst()
|
.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 {
|
fun getOwnedContentCount(creatorId: Long, memberId: Long): Long {
|
||||||
// 활성 주문 + 대여의 경우 유효기간 내 주문만 포함, 동일 콘텐츠 중복 구매는 1개로 카운트
|
// 활성 주문 + 대여의 경우 유효기간 내 주문만 포함, 동일 콘텐츠 중복 구매는 1개로 카운트
|
||||||
return queryFactory
|
return queryFactory
|
||||||
|
|||||||
@@ -287,9 +287,9 @@ class ExplorerService(
|
|||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
// 크리에이터의 전체 콘텐츠 개수
|
// 크리에이터의 전체 유료 콘텐츠 개수
|
||||||
val totalContentCount = if (isCreator) {
|
val totalContentCount = if (isCreator) {
|
||||||
queryRepository.getContentCount(creatorId) ?: 0
|
queryRepository.getPaidContentCount(creatorId) ?: 0
|
||||||
} else {
|
} else {
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user