콘텐츠 테마 조회 로직 수정
This commit is contained in:
@@ -6,6 +6,7 @@ import kr.co.vividnext.sodalive.content.main.banner.AudioContentBannerType
|
||||
import kr.co.vividnext.sodalive.content.main.banner.GetAudioContentBannerResponse
|
||||
import kr.co.vividnext.sodalive.content.main.curation.GetAudioContentCurationResponse
|
||||
import kr.co.vividnext.sodalive.content.theme.AudioContentThemeQueryRepository
|
||||
import kr.co.vividnext.sodalive.content.theme.AudioContentThemeService
|
||||
import kr.co.vividnext.sodalive.content.translation.ContentTranslationRepository
|
||||
import kr.co.vividnext.sodalive.event.EventItem
|
||||
import kr.co.vividnext.sodalive.i18n.LangContext
|
||||
@@ -22,6 +23,7 @@ class AudioContentMainService(
|
||||
private val repository: AudioContentRepository,
|
||||
private val blockMemberRepository: BlockMemberRepository,
|
||||
private val audioContentThemeRepository: AudioContentThemeQueryRepository,
|
||||
private val audioContentThemeService: AudioContentThemeService,
|
||||
|
||||
private val contentTranslationRepository: ContentTranslationRepository,
|
||||
|
||||
@@ -31,9 +33,21 @@ class AudioContentMainService(
|
||||
private val imageHost: String
|
||||
) {
|
||||
@Transactional(readOnly = true)
|
||||
@Cacheable(cacheNames = ["default"], key = "'themeList:' + ':' + #isAdult")
|
||||
fun getThemeList(isAdult: Boolean, contentType: ContentType): List<String> {
|
||||
return audioContentThemeRepository.getActiveThemeOfContent(isAdult = isAdult, contentType = contentType)
|
||||
/**
|
||||
* 콘텐츠 테마 조회
|
||||
*
|
||||
* - langContext에 따라 기본 한국어 데이터 혹은 번역된 콘텐츠 테마를 조회해야 함
|
||||
*
|
||||
* - 번역된 테마 데이터가 없다면 번역하여 반환
|
||||
* - 번역된 데이터가 있다면 번역된 데이터를 조회하여 반환
|
||||
*/
|
||||
// 표시용 테마 목록은 언어 컨텍스트에 따라 번역된 값을 반환해야 한다.
|
||||
// AudioContentThemeService가 번역/저장을 처리하므로 이를 사용한다.
|
||||
return audioContentThemeService.getActiveThemeOfContent(
|
||||
isAdult = isAdult,
|
||||
contentType = contentType
|
||||
)
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
|
||||
Reference in New Issue
Block a user