|
|
|
@ -10,22 +10,18 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import kr.xit.framework.biz.cache.mapper.ICacheBbsMapper;
|
|
|
|
|
import kr.xit.framework.biz.cache.mapper.ICacheCodeMapper;
|
|
|
|
|
import kr.xit.framework.biz.cache.mapper.ICacheMenuMapper;
|
|
|
|
|
import kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngVO;
|
|
|
|
|
import kr.xit.framework.support.mybatis.MybatisUtils;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
@Service
|
|
|
|
|
public class CacheService implements ICacheService {
|
|
|
|
|
@Resource
|
|
|
|
|
private ICacheCodeMapper codeMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private ICacheMenuMapper menuMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private ICacheBbsMapper bbsMapper;
|
|
|
|
|
|
|
|
|
|
@Value("#{prop['Globals.Xit.RollingNotiBbsId']}")
|
|
|
|
|
private String notiBbsId;
|
|
|
|
|
|
|
|
|
@ -34,7 +30,9 @@ public class CacheService implements ICacheService {
|
|
|
|
|
|
|
|
|
|
@Value("#{prop['Globals.Xit.Bbs.useAt']}")
|
|
|
|
|
private String useAt;
|
|
|
|
|
|
|
|
|
|
private final ICacheCodeMapper codeMapper;
|
|
|
|
|
private final ICacheMenuMapper menuMapper;
|
|
|
|
|
private final ICacheBbsMapper bbsMapper;
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------------------------------
|
|
|
|
|
// Common code
|
|
|
|
@ -47,6 +45,7 @@ public class CacheService implements ICacheService {
|
|
|
|
|
|
|
|
|
|
@Cacheable(cacheNames="codeComboCache", key = "#codeId + #type")
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
|
public List<Map<String, Object>> findComboCodes(final String codeId, final String type) {
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("codeId", codeId);
|
|
|
|
@ -56,11 +55,13 @@ public class CacheService implements ICacheService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@CacheEvict(cacheNames="codeCache", allEntries = true)
|
|
|
|
|
@Transactional
|
|
|
|
|
public void evictAllCodeCache() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@CacheEvict(cacheNames="codeCache", key = "#codeId + #type")
|
|
|
|
|
@Transactional
|
|
|
|
|
public void evictCodeCache(final String codeId, final String type) {
|
|
|
|
|
}
|
|
|
|
|
// ---------------------------------------------------------------------------------------------------------
|
|
|
|
@ -71,23 +72,27 @@ public class CacheService implements ICacheService {
|
|
|
|
|
// ---------------------------------------------------------------------------------------------------------
|
|
|
|
|
@Cacheable(cacheNames="menuCache", key = "#uniqId")
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
|
public List<Map<String, String>> findMenuListByUser(final String uniqId) {
|
|
|
|
|
return menuMapper.selectMenuListByUser(uniqId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Cacheable(cacheNames="menuCache", key = "#authorCode")
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
|
public List<Map<String, String>> findMenuListByAuthorCode(final String authorCode) {
|
|
|
|
|
return menuMapper.selectMenuListByAuthorCode(authorCode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@CacheEvict(cacheNames="menuCache", allEntries = true)
|
|
|
|
|
@Transactional
|
|
|
|
|
public void evictAllMenuCache() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@CacheEvict(cacheNames="menuCache", key = "#key")
|
|
|
|
|
@Transactional
|
|
|
|
|
public void evictMenuCache(final String key) {
|
|
|
|
|
}
|
|
|
|
|
// ---------------------------------------------------------------------------------------------------------
|
|
|
|
@ -99,6 +104,7 @@ public class CacheService implements ICacheService {
|
|
|
|
|
// ---------------------------------------------------------------------------------------------------------
|
|
|
|
|
@Override
|
|
|
|
|
@Cacheable(cacheNames="latestBbsCache")
|
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
|
public List<Map<String, Object>> findLatestBbsList() {
|
|
|
|
|
Map<String, Object> paraMap = new HashMap<>();
|
|
|
|
|
paraMap.put("bbsId", this.notiBbsId);
|
|
|
|
@ -111,17 +117,20 @@ public class CacheService implements ICacheService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Cacheable(cacheNames="baseBbsCache", key = "#paraMap")
|
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
|
public List<XitBasicBbsMngVO> findBaseBbsList(final Map<String, Object> paraMap) {
|
|
|
|
|
return bbsMapper.selectBaseBbsList(paraMap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@CacheEvict(cacheNames="latestBbsCache", allEntries = true)
|
|
|
|
|
@Transactional
|
|
|
|
|
public void evictLatestBbsList() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@CacheEvict(cacheNames="baseBbsCache", allEntries = true)
|
|
|
|
|
@Transactional
|
|
|
|
|
public void evictBaseBbsList(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|