@@ -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(
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -28,16 +28,6 @@ class AudioContentMainService(
|
||||
@Cacheable(cacheNames = ["default"], key = "'themeList:' + ':' + #isAdult")
|
||||
fun getThemeList(isAdult: Boolean, contentType: ContentType): List<String> {
|
||||
return audioContentThemeRepository.getActiveThemeOfContent(isAdult = isAdult, contentType = contentType)
|
||||
.filter {
|
||||
it != "모닝콜" &&
|
||||
it != "알람" &&
|
||||
it != "슬립콜" &&
|
||||
it != "다시듣기" &&
|
||||
it != "ASMR" &&
|
||||
it != "릴레이" &&
|
||||
it != "챌린지" &&
|
||||
it != "자기소개"
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
@@ -64,7 +54,6 @@ class AudioContentMainService(
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
fun getNewContentFor2WeeksByTheme(
|
||||
isFree: Boolean,
|
||||
theme: String,
|
||||
isAdultContentVisible: Boolean,
|
||||
contentType: ContentType,
|
||||
@@ -75,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,
|
||||
|
||||
Reference in New Issue
Block a user