数据字典信息

This commit is contained in:
2025-08-20 13:31:54 +08:00
parent 34ee4cceca
commit 7f65ebedc2
5 changed files with 34 additions and 0 deletions

View File

@ -73,4 +73,9 @@ public interface ISysDictDataService {
*/
boolean checkDictDataUnique(SysDictDataBo dict);
/**
* 清空字典缓存
*/
void clearDictTypeCache(String dictType);
}

View File

@ -92,4 +92,9 @@ public interface ISysDictTypeService {
* @return 结果
*/
boolean checkDictTypeUnique(SysDictTypeBo dictType);
/**
* 清空字典缓存
*/
void clearDictTypeCache(String dictType);
}

View File

@ -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) {
// 仅用于清除缓存
}
}

View File

@ -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) {
// 仅用于清除缓存
}
}