parent
ecddf9975f
commit
2f0182e06c
|
@ -31,6 +31,23 @@ class AudioContentMainTabContentController(private val service: AudioContentMain
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/ranking")
|
||||||
|
fun getAudioContentRanking(
|
||||||
|
@RequestParam("sort-type", required = false) sortType: String? = "매출",
|
||||||
|
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?,
|
||||||
|
pageable: Pageable
|
||||||
|
) = run {
|
||||||
|
if (member == null) throw SodaException("로그인 정보를 확인해주세요.")
|
||||||
|
|
||||||
|
ApiResponse.ok(
|
||||||
|
service.getAudioContentRanking(
|
||||||
|
memberId = member.id!!,
|
||||||
|
isAdult = member.auth != null,
|
||||||
|
sortType = sortType ?: "매출"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/new-content-by-theme")
|
@GetMapping("/new-content-by-theme")
|
||||||
fun getNewContentByTheme(
|
fun getNewContentByTheme(
|
||||||
@RequestParam("theme") theme: String,
|
@RequestParam("theme") theme: String,
|
||||||
|
|
|
@ -3,6 +3,7 @@ package kr.co.vividnext.sodalive.content.main.tab.content
|
||||||
import kr.co.vividnext.sodalive.content.AudioContentRepository
|
import kr.co.vividnext.sodalive.content.AudioContentRepository
|
||||||
import kr.co.vividnext.sodalive.content.ContentType
|
import kr.co.vividnext.sodalive.content.ContentType
|
||||||
import kr.co.vividnext.sodalive.content.main.GetAudioContentMainItem
|
import kr.co.vividnext.sodalive.content.main.GetAudioContentMainItem
|
||||||
|
import kr.co.vividnext.sodalive.content.main.GetAudioContentRankingItem
|
||||||
import kr.co.vividnext.sodalive.content.main.banner.AudioContentBannerService
|
import kr.co.vividnext.sodalive.content.main.banner.AudioContentBannerService
|
||||||
import kr.co.vividnext.sodalive.content.theme.AudioContentThemeQueryRepository
|
import kr.co.vividnext.sodalive.content.theme.AudioContentThemeQueryRepository
|
||||||
import kr.co.vividnext.sodalive.event.EventService
|
import kr.co.vividnext.sodalive.event.EventService
|
||||||
|
@ -104,6 +105,28 @@ class AudioContentMainTabContentService(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getAudioContentRanking(
|
||||||
|
memberId: Long,
|
||||||
|
isAdult: Boolean,
|
||||||
|
sortType: String = "매출"
|
||||||
|
): List<GetAudioContentRankingItem> {
|
||||||
|
val currentDateTime = LocalDateTime.now()
|
||||||
|
val dailyRankingStartDate = currentDateTime
|
||||||
|
.withHour(15)
|
||||||
|
.withMinute(0)
|
||||||
|
.withSecond(0)
|
||||||
|
.minusDays(2)
|
||||||
|
val dailyRankingEndDate = dailyRankingStartDate
|
||||||
|
.plusDays(1)
|
||||||
|
|
||||||
|
return rankingService.getContentRanking(
|
||||||
|
memberId = memberId,
|
||||||
|
isAdult = isAdult,
|
||||||
|
startDate = dailyRankingStartDate,
|
||||||
|
endDate = dailyRankingEndDate
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
fun getNewContentByTheme(
|
fun getNewContentByTheme(
|
||||||
theme: String,
|
theme: String,
|
||||||
isAdultContentVisible: Boolean,
|
isAdultContentVisible: Boolean,
|
||||||
|
|
Loading…
Reference in New Issue