parent
e488f3419e
commit
13a1fa674b
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -88,6 +88,7 @@ class AudioContentMainTabContentService(
|
|||
|
||||
val contentRankCreatorList = rankingService.fetchCreatorBySellContentCountRankTop20(
|
||||
memberId = member.id!!,
|
||||
isAdult = isAdult,
|
||||
contentType = contentType,
|
||||
startDate = dailyRankingStartDate,
|
||||
endDate = dailyRankingEndDate
|
||||
|
|
Loading…
Reference in New Issue