여러대의 Redis와 Valkey에 연결할 수 있도록 환경설정
This commit is contained in:
@@ -2,17 +2,12 @@ package kr.co.vividnext.sodalive.admin.calculate
|
||||
|
||||
import kr.co.vividnext.sodalive.creator.admin.calculate.GetCreatorCalculateCommunityPostResponse
|
||||
import kr.co.vividnext.sodalive.extensions.convertLocalDateTime
|
||||
import org.springframework.cache.annotation.Cacheable
|
||||
import org.springframework.stereotype.Service
|
||||
import org.springframework.transaction.annotation.Transactional
|
||||
|
||||
@Service
|
||||
class AdminCalculateService(private val repository: AdminCalculateQueryRepository) {
|
||||
@Transactional(readOnly = true)
|
||||
@Cacheable(
|
||||
cacheNames = ["cache_ttl_3_hours"],
|
||||
key = "'calculateLive:' + " + "#startDateStr + ':' + #endDateStr"
|
||||
)
|
||||
fun getCalculateLive(startDateStr: String, endDateStr: String): List<GetCalculateLiveResponse> {
|
||||
val startDate = startDateStr.convertLocalDateTime()
|
||||
val endDate = endDateStr.convertLocalDateTime(hour = 23, minute = 59, second = 59)
|
||||
@@ -23,10 +18,6 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
@Cacheable(
|
||||
cacheNames = ["cache_ttl_3_hours"],
|
||||
key = "'calculateContent:' + " + "#startDateStr + ':' + #endDateStr"
|
||||
)
|
||||
fun getCalculateContentList(startDateStr: String, endDateStr: String): List<GetCalculateContentResponse> {
|
||||
val startDate = startDateStr.convertLocalDateTime()
|
||||
val endDate = endDateStr.convertLocalDateTime(hour = 23, minute = 59, second = 59)
|
||||
@@ -37,10 +28,6 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
@Cacheable(
|
||||
cacheNames = ["cache_ttl_3_hours"],
|
||||
key = "'cumulativeSalesByContent:' + " + "#offset + ':' + #limit"
|
||||
)
|
||||
fun getCumulativeSalesByContent(offset: Long, limit: Long): GetCumulativeSalesByContentResponse {
|
||||
val totalCount = repository.getCumulativeSalesByContentTotalCount()
|
||||
val items = repository
|
||||
@@ -51,10 +38,6 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
@Cacheable(
|
||||
cacheNames = ["cache_ttl_3_hours"],
|
||||
key = "'calculateContentDonationList2:' + " + "#startDateStr + ':' + #endDateStr"
|
||||
)
|
||||
fun getCalculateContentDonationList(
|
||||
startDateStr: String,
|
||||
endDateStr: String
|
||||
@@ -68,10 +51,6 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
@Cacheable(
|
||||
cacheNames = ["cache_ttl_3_hours"],
|
||||
key = "'calculateCommunityPost:' + " + "#startDateStr + ':' + #endDateStr + ':' + #offset"
|
||||
)
|
||||
fun getCalculateCommunityPost(
|
||||
startDateStr: String,
|
||||
endDateStr: String,
|
||||
|
Reference in New Issue
Block a user