fix(latest-content): 최신 콘텐츠 전체보기에서 유/무료 모두 조회되도록 수정

This commit is contained in:
2025-11-18 19:21:15 +09:00
parent bc358d18de
commit 690432d6ee
3 changed files with 1 additions and 28 deletions

View File

@@ -109,7 +109,6 @@ interface AudioContentQueryRepository {
): Int
fun findByThemeFor2Weeks(
isFree: Boolean = false,
cloudfrontHost: String,
memberId: Long,
theme: List<String> = emptyList(),
@@ -120,7 +119,6 @@ interface AudioContentQueryRepository {
): List<GetAudioContentMainItem>
fun totalCountNewContentFor2Weeks(
isFree: Boolean = false,
theme: List<String> = emptyList(),
memberId: Long,
isAdult: Boolean,
@@ -695,7 +693,6 @@ class AudioContentQueryRepositoryImpl(
}
override fun totalCountNewContentFor2Weeks(
isFree: Boolean,
theme: List<String>,
memberId: Long,
isAdult: Boolean,
@@ -732,10 +729,6 @@ class AudioContentQueryRepositoryImpl(
where = where.and(audioContentTheme.theme.`in`(theme))
}
if (isFree) {
where = where.and(audioContent.price.loe(0))
}
return queryFactory
.select(audioContent.id)
.from(audioContent)
@@ -747,7 +740,6 @@ class AudioContentQueryRepositoryImpl(
}
override fun findByThemeFor2Weeks(
isFree: Boolean,
cloudfrontHost: String,
memberId: Long,
theme: List<String>,
@@ -787,10 +779,6 @@ class AudioContentQueryRepositoryImpl(
where = where.and(audioContentTheme.theme.`in`(theme))
}
if (isFree) {
where = where.and(audioContent.price.loe(0))
}
return queryFactory
.select(
QGetAudioContentMainItem(

View File

@@ -99,7 +99,6 @@ class AudioContentMainController(
@GetMapping("/new/all")
fun getNewContentAllByTheme(
@RequestParam("isFree", required = false) isFree: Boolean? = null,
@RequestParam("theme") theme: String,
@RequestParam("isAdultContentVisible", required = false) isAdultContentVisible: Boolean? = null,
@RequestParam("contentType", required = false) contentType: ContentType? = null,
@@ -110,7 +109,6 @@ class AudioContentMainController(
ApiResponse.ok(
service.getNewContentFor2WeeksByTheme(
isFree = isFree ?: false,
theme = theme,
isAdultContentVisible = isAdultContentVisible ?: true,
contentType = contentType ?: ContentType.ALL,

View File

@@ -54,7 +54,6 @@ class AudioContentMainService(
@Transactional(readOnly = true)
fun getNewContentFor2WeeksByTheme(
isFree: Boolean,
theme: String,
isAdultContentVisible: Boolean,
contentType: ContentType,
@@ -65,31 +64,19 @@ class AudioContentMainService(
val themeList = if (theme.isBlank()) {
audioContentThemeRepository.getActiveThemeOfContent(
isAdult = isAdult,
isFree = isFree,
contentType = contentType
).filter {
it != "모닝콜" &&
it != "알람" &&
it != "슬립콜" &&
it != "다시듣기" &&
it != "ASMR" &&
it != "릴레이" &&
it != "챌린지" &&
it != "자기소개"
}
)
} else {
listOf(theme)
}
val totalCount = repository.totalCountNewContentFor2Weeks(
isFree,
themeList,
memberId = member.id!!,
isAdult = isAdult,
contentType = contentType
)
val items = repository.findByThemeFor2Weeks(
isFree,
cloudfrontHost = imageHost,
memberId = member.id!!,
theme = themeList,