diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentController.kt b/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentController.kt index f5a529a..c9510ab 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentController.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentController.kt @@ -236,4 +236,24 @@ class AudioContentController(private val service: AudioContentService) { ApiResponse.ok(service.unpinAtTheTop(contentId = id, member = member)) } + + @GetMapping("/replay-live") + fun replayLive( + @RequestParam("isAdultContentVisible", required = false) isAdultContentVisible: Boolean? = null, + @RequestParam("contentType", required = false) contentType: ContentType? = null, + @AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member? + ) = run { + ApiResponse.ok( + service.getLatestContentByTheme( + theme = listOf("다시듣기"), + contentType = contentType ?: ContentType.ALL, + isFree = false, + isAdult = if (member != null) { + (isAdultContentVisible ?: true) && member.auth != null + } else { + false + } + ) + ) + } } diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentRepository.kt index 1ee6a50..40038d3 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentRepository.kt @@ -490,10 +490,8 @@ class AudioContentQueryRepositoryImpl( where = where.and(audioContentTheme.theme.`in`(theme)) } - where = if (isFree) { - where.and(audioContent.price.loe(0)) - } else { - where.and(audioContent.price.gt(0)) + if (isFree) { + where = where.and(audioContent.price.loe(0)) } return queryFactory