콘텐츠 메인 홈 - 인기 단편

- 19금 콘텐츠 보기 설정 적용
This commit is contained in:
Klaus 2025-03-19 14:26:03 +09:00
parent e488f3419e
commit 13a1fa674b
4 changed files with 23 additions and 1 deletions

View File

@ -175,6 +175,8 @@ class AudioContentController(private val service: AudioContentService) {
@GetMapping("/ranking")
fun getAudioContentRanking(
@RequestParam("sort-type", required = false) sortType: String? = "매출",
@RequestParam("isAdultContentVisible", required = false) isAdultContentVisible: Boolean? = null,
@RequestParam("contentType", required = false) contentType: ContentType? = null,
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?,
pageable: Pageable
) = run {
@ -192,7 +194,8 @@ class AudioContentController(private val service: AudioContentService) {
ApiResponse.ok(
service.getAudioContentRanking(
isAdult = member.auth != null,
isAdult = member.auth != null && (isAdultContentVisible ?: true),
contentType = contentType ?: ContentType.ALL,
startDate = startDate,
endDate = endDate,
offset = pageable.offset,

View File

@ -140,6 +140,7 @@ interface AudioContentQueryRepository {
fun getAudioContentRanking(
cloudfrontHost: String,
isAdult: Boolean,
contentType: ContentType,
startDate: LocalDateTime,
endDate: LocalDateTime,
offset: Long = 0,
@ -922,6 +923,7 @@ class AudioContentQueryRepositoryImpl(
override fun getAudioContentRanking(
cloudfrontHost: String,
isAdult: Boolean,
contentType: ContentType,
startDate: LocalDateTime,
endDate: LocalDateTime,
offset: Long,
@ -938,6 +940,20 @@ class AudioContentQueryRepositoryImpl(
if (!isAdult) {
where = where.and(audioContent.isAdult.isFalse)
} else {
if (contentType != ContentType.ALL) {
where = where.and(
audioContent.member.isNull.or(
audioContent.member.auth.gender.eq(
if (contentType == ContentType.MALE) {
0
} else {
1
}
)
)
)
}
}
var select = queryFactory

View File

@ -759,6 +759,7 @@ class AudioContentService(
)
fun getAudioContentRanking(
isAdult: Boolean,
contentType: ContentType,
startDate: LocalDateTime,
endDate: LocalDateTime,
offset: Long,
@ -774,6 +775,7 @@ class AudioContentService(
startDate = startDate.minusDays(1),
endDate = endDate.minusDays(1),
isAdult = isAdult,
contentType = contentType,
offset = offset,
limit = limit,
sortType = sortType

View File

@ -88,6 +88,7 @@ class AudioContentMainTabContentService(
val contentRankCreatorList = rankingService.fetchCreatorBySellContentCountRankTop20(
memberId = member.id!!,
isAdult = isAdult,
contentType = contentType,
startDate = dailyRankingStartDate,
endDate = dailyRankingEndDate