콘텐츠 메인 API - @Transactional(readOnly = true) 추가 #70
| @@ -577,6 +577,7 @@ class AudioContentService( | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Transactional(readOnly = true) | ||||||
|     @Cacheable( |     @Cacheable( | ||||||
|         cacheNames = ["cache_ttl_3_days"], |         cacheNames = ["cache_ttl_3_days"], | ||||||
|         key = "'contentRanking:' + ':' +" + |         key = "'contentRanking:' + ':' +" + | ||||||
|   | |||||||
| @@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Value | |||||||
| import org.springframework.cache.annotation.Cacheable | import org.springframework.cache.annotation.Cacheable | ||||||
| import org.springframework.data.domain.Pageable | import org.springframework.data.domain.Pageable | ||||||
| import org.springframework.stereotype.Service | import org.springframework.stereotype.Service | ||||||
|  | import org.springframework.transaction.annotation.Transactional | ||||||
| import java.time.DayOfWeek | import java.time.DayOfWeek | ||||||
| import java.time.LocalDateTime | import java.time.LocalDateTime | ||||||
| import java.time.temporal.TemporalAdjusters | import java.time.temporal.TemporalAdjusters | ||||||
| @@ -29,6 +30,7 @@ class AudioContentMainService( | |||||||
|     @Value("\${cloud.aws.cloud-front.host}") |     @Value("\${cloud.aws.cloud-front.host}") | ||||||
|     private val imageHost: String |     private val imageHost: String | ||||||
| ) { | ) { | ||||||
|  |     @Transactional(readOnly = true) | ||||||
|     fun getMain(memberId: Long, isAdult: Boolean): GetAudioContentMainResponse { |     fun getMain(memberId: Long, isAdult: Boolean): GetAudioContentMainResponse { | ||||||
|         // 2주일 이내에 콘텐츠를 올린 크리에이터 20명 조회 |         // 2주일 이내에 콘텐츠를 올린 크리에이터 20명 조회 | ||||||
|         val newContentUploadCreatorList = getNewContentUploadCreatorList(memberId = memberId, isAdult = isAdult) |         val newContentUploadCreatorList = getNewContentUploadCreatorList(memberId = memberId, isAdult = isAdult) | ||||||
| @@ -120,6 +122,7 @@ class AudioContentMainService( | |||||||
|         return GetNewContentAllResponse(totalCount, items) |         return GetNewContentAllResponse(totalCount, items) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Transactional(readOnly = true) | ||||||
|     @Cacheable(cacheNames = ["default"], key = "'newContentUploadCreatorList:' + #memberId + ':' + #isAdult") |     @Cacheable(cacheNames = ["default"], key = "'newContentUploadCreatorList:' + #memberId + ':' + #isAdult") | ||||||
|     fun getNewContentUploadCreatorList(memberId: Long, isAdult: Boolean): List<GetNewContentUploadCreator> { |     fun getNewContentUploadCreatorList(memberId: Long, isAdult: Boolean): List<GetNewContentUploadCreator> { | ||||||
|         return repository.getNewContentUploadCreatorList( |         return repository.getNewContentUploadCreatorList( | ||||||
| @@ -131,6 +134,7 @@ class AudioContentMainService( | |||||||
|             .toList() |             .toList() | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Transactional(readOnly = true) | ||||||
|     @Cacheable(cacheNames = ["default"], key = "'contentMainBannerList:' + #memberId + ':' + #isAdult") |     @Cacheable(cacheNames = ["default"], key = "'contentMainBannerList:' + #memberId + ':' + #isAdult") | ||||||
|     fun getAudioContentMainBannerList(memberId: Long, isAdult: Boolean) = |     fun getAudioContentMainBannerList(memberId: Long, isAdult: Boolean) = | ||||||
|         repository.getAudioContentMainBannerList(isAdult = isAdult) |         repository.getAudioContentMainBannerList(isAdult = isAdult) | ||||||
| @@ -180,6 +184,7 @@ class AudioContentMainService( | |||||||
|             } |             } | ||||||
|             .toList() |             .toList() | ||||||
|  |  | ||||||
|  |     @Transactional(readOnly = true) | ||||||
|     @Cacheable(cacheNames = ["default"], key = "'contentCurationList:' + #memberId + ':' + #isAdult") |     @Cacheable(cacheNames = ["default"], key = "'contentCurationList:' + #memberId + ':' + #isAdult") | ||||||
|     fun getAudioContentCurationList(memberId: Long, isAdult: Boolean) = |     fun getAudioContentCurationList(memberId: Long, isAdult: Boolean) = | ||||||
|         repository.getAudioContentCurations(isAdult = isAdult) |         repository.getAudioContentCurations(isAdult = isAdult) | ||||||
|   | |||||||
| @@ -92,6 +92,7 @@ class OrderService( | |||||||
|         ) |         ) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Transactional(readOnly = true) | ||||||
|     fun getAudioContentMainOrderList(memberId: Long, limit: Int): List<GetAudioContentMainItem> { |     fun getAudioContentMainOrderList(memberId: Long, limit: Int): List<GetAudioContentMainItem> { | ||||||
|         return repository.getAudioContentMainOrderList( |         return repository.getAudioContentMainOrderList( | ||||||
|             dateTime = LocalDateTime.now(), |             dateTime = LocalDateTime.now(), | ||||||
|   | |||||||
| @@ -6,6 +6,7 @@ import kr.co.vividnext.sodalive.content.theme.QAudioContentTheme.audioContentThe | |||||||
| import org.springframework.beans.factory.annotation.Value | import org.springframework.beans.factory.annotation.Value | ||||||
| import org.springframework.cache.annotation.Cacheable | import org.springframework.cache.annotation.Cacheable | ||||||
| import org.springframework.stereotype.Repository | import org.springframework.stereotype.Repository | ||||||
|  | import org.springframework.transaction.annotation.Transactional | ||||||
|  |  | ||||||
| @Repository | @Repository | ||||||
| class AudioContentThemeQueryRepository( | class AudioContentThemeQueryRepository( | ||||||
| @@ -28,6 +29,7 @@ class AudioContentThemeQueryRepository( | |||||||
|             .fetch() |             .fetch() | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Transactional(readOnly = true) | ||||||
|     @Cacheable(cacheNames = ["default"], key = "'activeThemeOfContent:' + ':' + #isAdult") |     @Cacheable(cacheNames = ["default"], key = "'activeThemeOfContent:' + ':' + #isAdult") | ||||||
|     fun getActiveThemeOfContent(isAdult: Boolean = false): List<String> { |     fun getActiveThemeOfContent(isAdult: Boolean = false): List<String> { | ||||||
|         var where = audioContent.isActive.isTrue |         var where = audioContent.isActive.isTrue | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user