fix: 메인 홈 API - 추천 채널
- 미인증 계정에서 19금 콘텐츠가 조회되지 않도록 수정
This commit is contained in:
@@ -60,7 +60,13 @@ class RecommendChannelQueryRepository(
|
||||
.fetch()
|
||||
}
|
||||
|
||||
fun getContentsByCreatorIdLikeDesc(creatorId: Long): List<RecommendChannelContentItem> {
|
||||
fun getContentsByCreatorIdLikeDesc(creatorId: Long, isAdult: Boolean): List<RecommendChannelContentItem> {
|
||||
var where = audioContent.member.id.eq(creatorId)
|
||||
|
||||
if (!isAdult) {
|
||||
where = where.and(audioContent.isAdult.isFalse)
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
.select(
|
||||
QRecommendChannelContentItem(
|
||||
@@ -82,7 +88,7 @@ class RecommendChannelQueryRepository(
|
||||
audioContentComment.audioContent.id.eq(audioContent.id)
|
||||
.and(audioContentComment.isActive.isTrue)
|
||||
)
|
||||
.where(audioContent.member.id.eq(creatorId))
|
||||
.where(where)
|
||||
.groupBy(audioContent.id)
|
||||
.orderBy(audioContentLike.id.countDistinct().desc())
|
||||
.limit(3)
|
||||
|
||||
@@ -23,7 +23,11 @@ class RecommendChannelQueryService(private val repository: RecommendChannelQuery
|
||||
)
|
||||
|
||||
return recommendChannelList.map {
|
||||
it.contentList = repository.getContentsByCreatorIdLikeDesc(it.channelId)
|
||||
it.contentList = repository.getContentsByCreatorIdLikeDesc(
|
||||
creatorId = it.channelId,
|
||||
isAdult = isAdult
|
||||
)
|
||||
|
||||
it
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user