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