캐시 handler 생성
로그 조회 갯수 캐싱 처리 로그 객체 생성 로그 엑셀 객체 생성 엑셀 진행률 관리 tracker 생성
This commit is contained in:
24
src/main/java/com/caliverse/admin/domain/cache/CommonCacheHandler.java
vendored
Normal file
24
src/main/java/com/caliverse/admin/domain/cache/CommonCacheHandler.java
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.caliverse.admin.domain.cache;
|
||||
|
||||
import com.caliverse.admin.domain.datacomponent.MetaDataFileLoader;
|
||||
import com.caliverse.admin.domain.request.LogGenericRequest;
|
||||
import com.caliverse.admin.logs.logservice.businesslogservice.BusinessLogGenericService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@EnableCaching(proxyTargetClass = true)
|
||||
public class CommonCacheHandler {
|
||||
@Autowired
|
||||
private BusinessLogGenericService businessLogGenericService;
|
||||
|
||||
@Cacheable(value = "businessLogCount", keyGenerator = "logCountKeyGenerator")
|
||||
public Integer getLogCount(LogGenericRequest logGenericRequest) {
|
||||
log.info("Cache MISS - Executing actual DB query for count");
|
||||
return businessLogGenericService.getRawLogCount(logGenericRequest);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user