콘텐츠 메인 무료 탭
- 채널별 추천 무료 콘텐츠 API 추가
This commit is contained in:
@@ -508,4 +508,38 @@ class RankingRepository(
|
||||
.limit(10)
|
||||
.fetch()
|
||||
}
|
||||
|
||||
fun fetchFreeContentByCreatorIdTop4(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)
|
||||
|
||||
if (!isAdult) {
|
||||
where = where.and(series.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(audioContent)
|
||||
.where(where)
|
||||
.orderBy(audioContent.playCount.desc())
|
||||
.offset(0)
|
||||
.limit(4)
|
||||
.fetch()
|
||||
}
|
||||
}
|
||||
|
@@ -209,4 +209,8 @@ class RankingService(
|
||||
val seriesList = repository.fetchCreatorSeriesBySales(creatorId = creatorId, isAdult = isAdult)
|
||||
return seriesToSeriesListItem(seriesList, isAdult)
|
||||
}
|
||||
|
||||
fun fetchFreeContentByCreatorIdTop4(creatorId: Long, isAdult: Boolean): List<GetAudioContentRankingItem> {
|
||||
return repository.fetchFreeContentByCreatorIdTop4(creatorId, isAdult)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user