parent
03bd915fa5
commit
2a96467d9c
|
@ -64,7 +64,7 @@ interface AudioContentQueryRepository {
|
||||||
|
|
||||||
fun findByTheme(
|
fun findByTheme(
|
||||||
memberId: Long,
|
memberId: Long,
|
||||||
theme: String = "",
|
theme: List<String> = emptyList(),
|
||||||
sortType: SortType = SortType.NEWEST,
|
sortType: SortType = SortType.NEWEST,
|
||||||
isAdult: Boolean = false,
|
isAdult: Boolean = false,
|
||||||
contentType: ContentType,
|
contentType: ContentType,
|
||||||
|
@ -89,7 +89,7 @@ interface AudioContentQueryRepository {
|
||||||
|
|
||||||
fun totalCountByTheme(
|
fun totalCountByTheme(
|
||||||
memberId: Long,
|
memberId: Long,
|
||||||
theme: String = "",
|
theme: List<String> = emptyList(),
|
||||||
isAdult: Boolean = false,
|
isAdult: Boolean = false,
|
||||||
contentType: ContentType
|
contentType: ContentType
|
||||||
): Int
|
): Int
|
||||||
|
@ -98,7 +98,7 @@ interface AudioContentQueryRepository {
|
||||||
isFree: Boolean = false,
|
isFree: Boolean = false,
|
||||||
cloudfrontHost: String,
|
cloudfrontHost: String,
|
||||||
memberId: Long,
|
memberId: Long,
|
||||||
theme: String = "",
|
theme: List<String> = emptyList(),
|
||||||
isAdult: Boolean = false,
|
isAdult: Boolean = false,
|
||||||
contentType: ContentType,
|
contentType: ContentType,
|
||||||
offset: Long = 0,
|
offset: Long = 0,
|
||||||
|
@ -107,7 +107,7 @@ interface AudioContentQueryRepository {
|
||||||
|
|
||||||
fun totalCountNewContentFor2Weeks(
|
fun totalCountNewContentFor2Weeks(
|
||||||
isFree: Boolean = false,
|
isFree: Boolean = false,
|
||||||
theme: String,
|
theme: List<String> = emptyList(),
|
||||||
memberId: Long,
|
memberId: Long,
|
||||||
isAdult: Boolean,
|
isAdult: Boolean,
|
||||||
contentType: ContentType
|
contentType: ContentType
|
||||||
|
@ -360,7 +360,7 @@ class AudioContentQueryRepositoryImpl(
|
||||||
|
|
||||||
override fun findByTheme(
|
override fun findByTheme(
|
||||||
memberId: Long,
|
memberId: Long,
|
||||||
theme: String,
|
theme: List<String>,
|
||||||
sortType: SortType,
|
sortType: SortType,
|
||||||
isAdult: Boolean,
|
isAdult: Boolean,
|
||||||
contentType: ContentType,
|
contentType: ContentType,
|
||||||
|
@ -406,8 +406,8 @@ class AudioContentQueryRepositoryImpl(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (theme.isNotBlank()) {
|
if (theme.isNotEmpty()) {
|
||||||
where = where.and(audioContentTheme.theme.eq(theme))
|
where = where.and(audioContentTheme.theme.`in`(theme))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isFree) {
|
if (isFree) {
|
||||||
|
@ -525,7 +525,12 @@ class AudioContentQueryRepositoryImpl(
|
||||||
.size
|
.size
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun totalCountByTheme(memberId: Long, theme: String, isAdult: Boolean, contentType: ContentType): Int {
|
override fun totalCountByTheme(
|
||||||
|
memberId: Long,
|
||||||
|
theme: List<String>,
|
||||||
|
isAdult: Boolean,
|
||||||
|
contentType: ContentType
|
||||||
|
): Int {
|
||||||
var where = audioContent.isActive.isTrue
|
var where = audioContent.isActive.isTrue
|
||||||
.and(audioContent.duration.isNotNull)
|
.and(audioContent.duration.isNotNull)
|
||||||
.and(
|
.and(
|
||||||
|
@ -544,8 +549,8 @@ class AudioContentQueryRepositoryImpl(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (theme.isNotBlank()) {
|
if (theme.isNotEmpty()) {
|
||||||
where = where.and(audioContentTheme.theme.eq(theme))
|
where = where.and(audioContentTheme.theme.`in`(theme))
|
||||||
}
|
}
|
||||||
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
|
@ -560,7 +565,7 @@ class AudioContentQueryRepositoryImpl(
|
||||||
|
|
||||||
override fun totalCountNewContentFor2Weeks(
|
override fun totalCountNewContentFor2Weeks(
|
||||||
isFree: Boolean,
|
isFree: Boolean,
|
||||||
theme: String,
|
theme: List<String>,
|
||||||
memberId: Long,
|
memberId: Long,
|
||||||
isAdult: Boolean,
|
isAdult: Boolean,
|
||||||
contentType: ContentType
|
contentType: ContentType
|
||||||
|
@ -584,8 +589,8 @@ class AudioContentQueryRepositoryImpl(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (theme.isNotBlank()) {
|
if (theme.isNotEmpty()) {
|
||||||
where = where.and(audioContentTheme.theme.eq(theme))
|
where = where.and(audioContentTheme.theme.`in`(theme))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isFree) {
|
if (isFree) {
|
||||||
|
@ -606,7 +611,7 @@ class AudioContentQueryRepositoryImpl(
|
||||||
isFree: Boolean,
|
isFree: Boolean,
|
||||||
cloudfrontHost: String,
|
cloudfrontHost: String,
|
||||||
memberId: Long,
|
memberId: Long,
|
||||||
theme: String,
|
theme: List<String>,
|
||||||
isAdult: Boolean,
|
isAdult: Boolean,
|
||||||
contentType: ContentType,
|
contentType: ContentType,
|
||||||
offset: Long,
|
offset: Long,
|
||||||
|
@ -631,8 +636,8 @@ class AudioContentQueryRepositoryImpl(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (theme.isNotBlank()) {
|
if (theme.isNotEmpty()) {
|
||||||
where = where.and(audioContentTheme.theme.eq(theme))
|
where = where.and(audioContentTheme.theme.`in`(theme))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isFree) {
|
if (isFree) {
|
||||||
|
|
|
@ -28,6 +28,17 @@ class AudioContentMainService(
|
||||||
@Cacheable(cacheNames = ["default"], key = "'themeList:' + ':' + #isAdult")
|
@Cacheable(cacheNames = ["default"], key = "'themeList:' + ':' + #isAdult")
|
||||||
fun getThemeList(isAdult: Boolean): List<String> {
|
fun getThemeList(isAdult: Boolean): List<String> {
|
||||||
return audioContentThemeRepository.getActiveThemeOfContent(isAdult = isAdult)
|
return audioContentThemeRepository.getActiveThemeOfContent(isAdult = isAdult)
|
||||||
|
.filter {
|
||||||
|
it != "오디오북" &&
|
||||||
|
it != "모닝콜" &&
|
||||||
|
it != "알람" &&
|
||||||
|
it != "슬립콜" &&
|
||||||
|
it != "다시듣기" &&
|
||||||
|
it != "ASMR" &&
|
||||||
|
it != "릴레이" &&
|
||||||
|
it != "챌린지" &&
|
||||||
|
it != "자기소개"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
|
@ -40,7 +51,7 @@ class AudioContentMainService(
|
||||||
): List<GetAudioContentMainItem> {
|
): List<GetAudioContentMainItem> {
|
||||||
return repository.findByTheme(
|
return repository.findByTheme(
|
||||||
memberId = member.id!!,
|
memberId = member.id!!,
|
||||||
theme = theme,
|
theme = listOf(theme),
|
||||||
isAdult = member.auth != null && isAdultContentVisible,
|
isAdult = member.auth != null && isAdultContentVisible,
|
||||||
contentType = contentType,
|
contentType = contentType,
|
||||||
offset = pageable.offset,
|
offset = pageable.offset,
|
||||||
|
@ -57,19 +68,37 @@ class AudioContentMainService(
|
||||||
member: Member,
|
member: Member,
|
||||||
pageable: Pageable
|
pageable: Pageable
|
||||||
): GetNewContentAllResponse {
|
): GetNewContentAllResponse {
|
||||||
|
val isAdult = member.auth != null && isAdultContentVisible
|
||||||
|
val themeList = if (theme.isBlank()) {
|
||||||
|
audioContentThemeRepository.getActiveThemeOfContent(isAdult = isAdult)
|
||||||
|
.filter {
|
||||||
|
it != "오디오북" &&
|
||||||
|
it != "모닝콜" &&
|
||||||
|
it != "알람" &&
|
||||||
|
it != "슬립콜" &&
|
||||||
|
it != "다시듣기" &&
|
||||||
|
it != "ASMR" &&
|
||||||
|
it != "릴레이" &&
|
||||||
|
it != "챌린지" &&
|
||||||
|
it != "자기소개"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
listOf(theme)
|
||||||
|
}
|
||||||
|
|
||||||
val totalCount = repository.totalCountNewContentFor2Weeks(
|
val totalCount = repository.totalCountNewContentFor2Weeks(
|
||||||
isFree,
|
isFree,
|
||||||
theme,
|
themeList,
|
||||||
memberId = member.id!!,
|
memberId = member.id!!,
|
||||||
isAdult = member.auth != null && isAdultContentVisible,
|
isAdult = isAdult,
|
||||||
contentType = contentType
|
contentType = contentType
|
||||||
)
|
)
|
||||||
val items = repository.findByThemeFor2Weeks(
|
val items = repository.findByThemeFor2Weeks(
|
||||||
isFree,
|
isFree,
|
||||||
cloudfrontHost = imageHost,
|
cloudfrontHost = imageHost,
|
||||||
memberId = member.id!!,
|
memberId = member.id!!,
|
||||||
theme = theme,
|
theme = themeList,
|
||||||
isAdult = member.auth != null && isAdultContentVisible,
|
isAdult = isAdult,
|
||||||
contentType = contentType,
|
contentType = contentType,
|
||||||
offset = pageable.offset,
|
offset = pageable.offset,
|
||||||
limit = pageable.pageSize.toLong()
|
limit = pageable.pageSize.toLong()
|
||||||
|
|
|
@ -35,7 +35,7 @@ class AudioContentMainTabAsmrService(
|
||||||
|
|
||||||
val newAsmrContentList = contentRepository.findByTheme(
|
val newAsmrContentList = contentRepository.findByTheme(
|
||||||
memberId = memberId,
|
memberId = memberId,
|
||||||
theme = theme,
|
theme = listOf(theme),
|
||||||
isAdult = isAdult,
|
isAdult = isAdult,
|
||||||
contentType = ContentType.ALL,
|
contentType = ContentType.ALL,
|
||||||
limit = 10
|
limit = 10
|
||||||
|
|
|
@ -57,7 +57,7 @@ class AudioContentMainTabContentService(
|
||||||
// 새로운 단편
|
// 새로운 단편
|
||||||
val newContentList = audioContentRepository.findByTheme(
|
val newContentList = audioContentRepository.findByTheme(
|
||||||
memberId = member.id!!,
|
memberId = member.id!!,
|
||||||
theme = "",
|
theme = themeOfContentList,
|
||||||
isAdult = member.auth != null,
|
isAdult = member.auth != null,
|
||||||
contentType = ContentType.ALL,
|
contentType = ContentType.ALL,
|
||||||
offset = 0,
|
offset = 0,
|
||||||
|
@ -167,10 +167,29 @@ class AudioContentMainTabContentService(
|
||||||
contentType: ContentType,
|
contentType: ContentType,
|
||||||
member: Member
|
member: Member
|
||||||
): List<GetAudioContentMainItem> {
|
): List<GetAudioContentMainItem> {
|
||||||
|
val isAdult = member.auth != null && isAdultContentVisible
|
||||||
|
|
||||||
|
val themeList = if (theme.isBlank()) {
|
||||||
|
audioContentThemeRepository.getActiveThemeOfContent(isAdult = isAdult)
|
||||||
|
.filter {
|
||||||
|
it != "오디오북" &&
|
||||||
|
it != "모닝콜" &&
|
||||||
|
it != "알람" &&
|
||||||
|
it != "슬립콜" &&
|
||||||
|
it != "다시듣기" &&
|
||||||
|
it != "ASMR" &&
|
||||||
|
it != "릴레이" &&
|
||||||
|
it != "챌린지" &&
|
||||||
|
it != "자기소개"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
listOf(theme)
|
||||||
|
}
|
||||||
|
|
||||||
return audioContentRepository.findByTheme(
|
return audioContentRepository.findByTheme(
|
||||||
memberId = member.id!!,
|
memberId = member.id!!,
|
||||||
theme = theme,
|
theme = themeList,
|
||||||
isAdult = member.auth != null && isAdultContentVisible,
|
isAdult = isAdult,
|
||||||
contentType = contentType,
|
contentType = contentType,
|
||||||
offset = 0,
|
offset = 0,
|
||||||
limit = 10
|
limit = 10
|
||||||
|
|
|
@ -137,7 +137,7 @@ class AudioContentMainTabFreeService(
|
||||||
): List<GetAudioContentMainItem> {
|
): List<GetAudioContentMainItem> {
|
||||||
return audioContentRepository.findByTheme(
|
return audioContentRepository.findByTheme(
|
||||||
memberId = member.id!!,
|
memberId = member.id!!,
|
||||||
theme = theme,
|
theme = listOf(theme),
|
||||||
isAdult = member.auth != null && isAdultContentVisible,
|
isAdult = member.auth != null && isAdultContentVisible,
|
||||||
contentType = contentType,
|
contentType = contentType,
|
||||||
offset = offset,
|
offset = offset,
|
||||||
|
|
|
@ -35,7 +35,7 @@ class AudioContentMainTabLiveReplayService(
|
||||||
|
|
||||||
val newLiveReplayContentList = contentRepository.findByTheme(
|
val newLiveReplayContentList = contentRepository.findByTheme(
|
||||||
memberId = memberId,
|
memberId = memberId,
|
||||||
theme = theme,
|
theme = listOf(theme),
|
||||||
isAdult = isAdult,
|
isAdult = isAdult,
|
||||||
contentType = ContentType.ALL,
|
contentType = ContentType.ALL,
|
||||||
limit = 10
|
limit = 10
|
||||||
|
|
|
@ -34,14 +34,14 @@ class AudioContentThemeService(
|
||||||
|
|
||||||
val totalCount = contentRepository.totalCountByTheme(
|
val totalCount = contentRepository.totalCountByTheme(
|
||||||
memberId = member.id!!,
|
memberId = member.id!!,
|
||||||
theme = theme.theme,
|
theme = listOf(theme.theme),
|
||||||
isAdult = member.auth != null && isAdultContentVisible,
|
isAdult = member.auth != null && isAdultContentVisible,
|
||||||
contentType = contentType
|
contentType = contentType
|
||||||
)
|
)
|
||||||
|
|
||||||
val items = contentRepository.findByTheme(
|
val items = contentRepository.findByTheme(
|
||||||
memberId = member.id!!,
|
memberId = member.id!!,
|
||||||
theme = theme.theme,
|
theme = listOf(theme.theme),
|
||||||
sortType = sortType,
|
sortType = sortType,
|
||||||
isAdult = member.auth != null && isAdultContentVisible,
|
isAdult = member.auth != null && isAdultContentVisible,
|
||||||
contentType = contentType,
|
contentType = contentType,
|
||||||
|
|
Loading…
Reference in New Issue