fix: 메인 홈 API - 추천 채널

- 미인증 계정에서 19금 콘텐츠가 조회되지 않도록 수정
This commit is contained in:
2025-07-15 01:28:42 +09:00
parent edf16a6021
commit 0d2daf4d2c
3 changed files with 13 additions and 5 deletions

View File

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

View File

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