콘텐츠 메인 캐싱 전략 변경 - repository 에 있던 @Cacheable 을 service 코드로 이동

This commit is contained in:
2023-10-27 01:08:40 +09:00
parent 3ec16b5045
commit 1c7fdfac69
3 changed files with 119 additions and 79 deletions

View File

@@ -4,6 +4,7 @@ import com.querydsl.jpa.impl.JPAQueryFactory
import kr.co.vividnext.sodalive.content.QAudioContent.audioContent
import kr.co.vividnext.sodalive.content.theme.QAudioContentTheme.audioContentTheme
import org.springframework.beans.factory.annotation.Value
import org.springframework.cache.annotation.Cacheable
import org.springframework.stereotype.Repository
@Repository
@@ -27,6 +28,7 @@ class AudioContentThemeQueryRepository(
.fetch()
}
@Cacheable(cacheNames = ["default"], key = "'getActiveThemeOfContent:' + ':' + #isAdult")
fun getActiveThemeOfContent(isAdult: Boolean = false): List<String> {
var where = audioContent.isActive.isTrue
.and(audioContentTheme.isActive.isTrue)