fix: 라이브 다시듣기 콘텐츠 API 추가

This commit is contained in:
Klaus 2025-07-18 20:27:02 +09:00
parent d18c19dd35
commit 8e877a6366
2 changed files with 22 additions and 4 deletions

View File

@ -236,4 +236,24 @@ class AudioContentController(private val service: AudioContentService) {
ApiResponse.ok(service.unpinAtTheTop(contentId = id, member = member)) 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
}
)
)
}
} }

View File

@ -490,10 +490,8 @@ class AudioContentQueryRepositoryImpl(
where = where.and(audioContentTheme.theme.`in`(theme)) where = where.and(audioContentTheme.theme.`in`(theme))
} }
where = if (isFree) { if (isFree) {
where.and(audioContent.price.loe(0)) where = where.and(audioContent.price.loe(0))
} else {
where.and(audioContent.price.gt(0))
} }
return queryFactory return queryFactory