parent
e488f3419e
commit
13a1fa674b
|
@ -175,6 +175,8 @@ class AudioContentController(private val service: AudioContentService) {
|
||||||
@GetMapping("/ranking")
|
@GetMapping("/ranking")
|
||||||
fun getAudioContentRanking(
|
fun getAudioContentRanking(
|
||||||
@RequestParam("sort-type", required = false) sortType: String? = "매출",
|
@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?,
|
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?,
|
||||||
pageable: Pageable
|
pageable: Pageable
|
||||||
) = run {
|
) = run {
|
||||||
|
@ -192,7 +194,8 @@ class AudioContentController(private val service: AudioContentService) {
|
||||||
|
|
||||||
ApiResponse.ok(
|
ApiResponse.ok(
|
||||||
service.getAudioContentRanking(
|
service.getAudioContentRanking(
|
||||||
isAdult = member.auth != null,
|
isAdult = member.auth != null && (isAdultContentVisible ?: true),
|
||||||
|
contentType = contentType ?: ContentType.ALL,
|
||||||
startDate = startDate,
|
startDate = startDate,
|
||||||
endDate = endDate,
|
endDate = endDate,
|
||||||
offset = pageable.offset,
|
offset = pageable.offset,
|
||||||
|
|
|
@ -140,6 +140,7 @@ interface AudioContentQueryRepository {
|
||||||
fun getAudioContentRanking(
|
fun getAudioContentRanking(
|
||||||
cloudfrontHost: String,
|
cloudfrontHost: String,
|
||||||
isAdult: Boolean,
|
isAdult: Boolean,
|
||||||
|
contentType: ContentType,
|
||||||
startDate: LocalDateTime,
|
startDate: LocalDateTime,
|
||||||
endDate: LocalDateTime,
|
endDate: LocalDateTime,
|
||||||
offset: Long = 0,
|
offset: Long = 0,
|
||||||
|
@ -922,6 +923,7 @@ class AudioContentQueryRepositoryImpl(
|
||||||
override fun getAudioContentRanking(
|
override fun getAudioContentRanking(
|
||||||
cloudfrontHost: String,
|
cloudfrontHost: String,
|
||||||
isAdult: Boolean,
|
isAdult: Boolean,
|
||||||
|
contentType: ContentType,
|
||||||
startDate: LocalDateTime,
|
startDate: LocalDateTime,
|
||||||
endDate: LocalDateTime,
|
endDate: LocalDateTime,
|
||||||
offset: Long,
|
offset: Long,
|
||||||
|
@ -938,6 +940,20 @@ class AudioContentQueryRepositoryImpl(
|
||||||
|
|
||||||
if (!isAdult) {
|
if (!isAdult) {
|
||||||
where = where.and(audioContent.isAdult.isFalse)
|
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
|
var select = queryFactory
|
||||||
|
|
|
@ -759,6 +759,7 @@ class AudioContentService(
|
||||||
)
|
)
|
||||||
fun getAudioContentRanking(
|
fun getAudioContentRanking(
|
||||||
isAdult: Boolean,
|
isAdult: Boolean,
|
||||||
|
contentType: ContentType,
|
||||||
startDate: LocalDateTime,
|
startDate: LocalDateTime,
|
||||||
endDate: LocalDateTime,
|
endDate: LocalDateTime,
|
||||||
offset: Long,
|
offset: Long,
|
||||||
|
@ -774,6 +775,7 @@ class AudioContentService(
|
||||||
startDate = startDate.minusDays(1),
|
startDate = startDate.minusDays(1),
|
||||||
endDate = endDate.minusDays(1),
|
endDate = endDate.minusDays(1),
|
||||||
isAdult = isAdult,
|
isAdult = isAdult,
|
||||||
|
contentType = contentType,
|
||||||
offset = offset,
|
offset = offset,
|
||||||
limit = limit,
|
limit = limit,
|
||||||
sortType = sortType
|
sortType = sortType
|
||||||
|
|
|
@ -88,6 +88,7 @@ class AudioContentMainTabContentService(
|
||||||
|
|
||||||
val contentRankCreatorList = rankingService.fetchCreatorBySellContentCountRankTop20(
|
val contentRankCreatorList = rankingService.fetchCreatorBySellContentCountRankTop20(
|
||||||
memberId = member.id!!,
|
memberId = member.id!!,
|
||||||
|
isAdult = isAdult,
|
||||||
contentType = contentType,
|
contentType = contentType,
|
||||||
startDate = dailyRankingStartDate,
|
startDate = dailyRankingStartDate,
|
||||||
endDate = dailyRankingEndDate
|
endDate = dailyRankingEndDate
|
||||||
|
|
Loading…
Reference in New Issue