콘텐츠 메인 콘텐츠 탭 - 채널별 추천 단편 #274
|
@ -89,8 +89,8 @@ class AudioContentMainTabContentService(
|
|||
endDate = dailyRankingEndDate
|
||||
)
|
||||
|
||||
val salesCountRankContentList = if (contentRankCreatorList.isNotEmpty()) {
|
||||
rankingService.fetchCreatorContentBySalesCountTop4(
|
||||
val likeCountRankContentList = if (contentRankCreatorList.isNotEmpty()) {
|
||||
rankingService.fetchCreatorContentByLikeCountTop4(
|
||||
creatorId = contentRankCreatorList[0].creatorId,
|
||||
isAdult = member.auth != null
|
||||
)
|
||||
|
@ -129,7 +129,8 @@ class AudioContentMainTabContentService(
|
|||
rankSortTypeList = listOf("매출", "댓글", "좋아요"),
|
||||
rankContentList = rankContentList,
|
||||
contentRankCreatorList = contentRankCreatorList,
|
||||
salesCountRankContentList = salesCountRankContentList,
|
||||
likeCountRankContentList = likeCountRankContentList,
|
||||
salesCountRankContentList = likeCountRankContentList,
|
||||
eventBannerList = eventBannerList,
|
||||
tagList = tagList,
|
||||
tagCurationContentList = tagCurationContentList,
|
||||
|
@ -195,7 +196,7 @@ class AudioContentMainTabContentService(
|
|||
}
|
||||
|
||||
fun getPopularContentByCreator(creatorId: Long, isAdult: Boolean): List<GetAudioContentRankingItem> {
|
||||
return rankingService.fetchCreatorContentBySalesCountTop4(
|
||||
return rankingService.fetchCreatorContentByLikeCountTop4(
|
||||
creatorId = creatorId,
|
||||
isAdult = isAdult
|
||||
)
|
||||
|
|
|
@ -15,6 +15,7 @@ data class GetContentMainTabContentResponse(
|
|||
val rankSortTypeList: List<String>,
|
||||
val rankContentList: List<GetAudioContentRankingItem>,
|
||||
val contentRankCreatorList: List<ContentCreatorResponse>,
|
||||
val likeCountRankContentList: List<GetAudioContentRankingItem>,
|
||||
val salesCountRankContentList: List<GetAudioContentRankingItem>,
|
||||
val eventBannerList: GetEventResponse,
|
||||
val tagList: List<String>,
|
||||
|
|
|
@ -537,4 +537,43 @@ class RankingRepository(
|
|||
.limit(4)
|
||||
.fetch()
|
||||
}
|
||||
|
||||
fun fetchCreatorContentByLikeCountTop4(creatorId: Long, isAdult: Boolean): List<GetAudioContentRankingItem> {
|
||||
var where = member.isActive.isTrue
|
||||
.and(member.id.eq(creatorId))
|
||||
.and(member.role.eq(MemberRole.CREATOR))
|
||||
.and(audioContent.isActive.isTrue)
|
||||
.and(audioContent.duration.isNotNull)
|
||||
.and(audioContent.limited.isNull)
|
||||
.and(audioContentLike.isActive.isTrue)
|
||||
|
||||
if (!isAdult) {
|
||||
where = where.and(audioContent.isAdult.isFalse)
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
.select(
|
||||
QGetAudioContentRankingItem(
|
||||
audioContent.id,
|
||||
audioContent.title,
|
||||
audioContent.coverImage.prepend("/").prepend(imageHost),
|
||||
audioContentTheme.theme,
|
||||
audioContent.price,
|
||||
audioContent.duration,
|
||||
member.id,
|
||||
member.nickname,
|
||||
member.profileImage.prepend("/").prepend(imageHost)
|
||||
)
|
||||
)
|
||||
.from(audioContentLike)
|
||||
.innerJoin(audioContentLike.audioContent, audioContent)
|
||||
.innerJoin(audioContent.theme, audioContentTheme)
|
||||
.innerJoin(audioContent.member, member)
|
||||
.where(where)
|
||||
.groupBy(audioContent.id)
|
||||
.orderBy(audioContentLike.id.count().desc())
|
||||
.offset(0)
|
||||
.limit(4)
|
||||
.fetch()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -193,6 +193,10 @@ class RankingService(
|
|||
return repository.fetchCreatorContentBySalesCountTop4(creatorId, isAdult, theme)
|
||||
}
|
||||
|
||||
fun fetchCreatorContentByLikeCountTop4(creatorId: Long, isAdult: Boolean): List<GetAudioContentRankingItem> {
|
||||
return repository.fetchCreatorContentByLikeCountTop4(creatorId, isAdult)
|
||||
}
|
||||
|
||||
fun fetchCreatorBySeriesRevenueRankTop20(
|
||||
memberId: Long,
|
||||
startDate: LocalDateTime,
|
||||
|
|
Loading…
Reference in New Issue