数据字典信息
This commit is contained in:
@ -73,4 +73,9 @@ public interface ISysDictDataService {
|
||||
*/
|
||||
boolean checkDictDataUnique(SysDictDataBo dict);
|
||||
|
||||
/**
|
||||
* 清空字典缓存
|
||||
*/
|
||||
void clearDictTypeCache(String dictType);
|
||||
|
||||
}
|
||||
|
||||
@ -92,4 +92,9 @@ public interface ISysDictTypeService {
|
||||
* @return 结果
|
||||
*/
|
||||
boolean checkDictTypeUnique(SysDictTypeBo dictType);
|
||||
|
||||
/**
|
||||
* 清空字典缓存
|
||||
*/
|
||||
void clearDictTypeCache(String dictType);
|
||||
}
|
||||
|
||||
@ -18,6 +18,7 @@ import com.fuyuanshen.system.domain.vo.SysDictDataVo;
|
||||
import com.fuyuanshen.system.mapper.SysDictDataMapper;
|
||||
import com.fuyuanshen.system.service.ISysDictDataService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.CachePut;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -154,4 +155,12 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 清除指定dictType的缓存
|
||||
@CacheEvict(cacheNames = CacheNames.SYS_DICT, key = "#dictType")
|
||||
public void clearDictTypeCache(String dictType) {
|
||||
// 仅用于清除缓存
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -28,6 +28,7 @@ import com.fuyuanshen.system.domain.vo.SysDictTypeVo;
|
||||
import com.fuyuanshen.system.mapper.SysDictDataMapper;
|
||||
import com.fuyuanshen.system.mapper.SysDictTypeMapper;
|
||||
import com.fuyuanshen.system.service.ISysDictTypeService;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.CachePut;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -294,4 +295,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
|
||||
return BeanUtil.copyToList(list, DictDataDTO.class);
|
||||
}
|
||||
|
||||
|
||||
// 清除指定dictType的缓存
|
||||
@CacheEvict(cacheNames = CacheNames.SYS_DICT, key = "#dictType")
|
||||
public void clearDictTypeCache(String dictType) {
|
||||
// 仅用于清除缓存
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user