fix 修复 字典缓存注解使用错误问题
This commit is contained in:
parent
08ba802e12
commit
9b9f424e6c
@ -75,7 +75,7 @@ public interface ISysDictTypeService {
|
|||||||
* @param bo 字典类型信息
|
* @param bo 字典类型信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
List<SysDictTypeVo> insertDictType(SysDictTypeBo bo);
|
List<SysDictDataVo> insertDictType(SysDictTypeBo bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存字典类型信息
|
* 修改保存字典类型信息
|
||||||
|
@ -123,7 +123,6 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
|
|||||||
* @param dictType 字典类型
|
* @param dictType 字典类型
|
||||||
* @return 字典类型
|
* @return 字典类型
|
||||||
*/
|
*/
|
||||||
@Cacheable(cacheNames = CacheNames.SYS_DICT, key = "#dictType")
|
|
||||||
@Override
|
@Override
|
||||||
public SysDictTypeVo selectDictTypeByType(String dictType) {
|
public SysDictTypeVo selectDictTypeByType(String dictType) {
|
||||||
return baseMapper.selectVoById(new LambdaQueryWrapper<SysDictType>().eq(SysDictType::getDictType, dictType));
|
return baseMapper.selectVoById(new LambdaQueryWrapper<SysDictType>().eq(SysDictType::getDictType, dictType));
|
||||||
@ -163,10 +162,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
|
|||||||
*/
|
*/
|
||||||
@CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType")
|
@CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType")
|
||||||
@Override
|
@Override
|
||||||
public List<SysDictTypeVo> insertDictType(SysDictTypeBo bo) {
|
public List<SysDictDataVo> insertDictType(SysDictTypeBo bo) {
|
||||||
SysDictType dict = MapstructUtils.convert(bo, SysDictType.class);
|
SysDictType dict = MapstructUtils.convert(bo, SysDictType.class);
|
||||||
int row = baseMapper.insert(dict);
|
int row = baseMapper.insert(dict);
|
||||||
if (row > 0) {
|
if (row > 0) {
|
||||||
|
// 新增 type 下无 data 数据 返回空防止缓存穿透
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
throw new ServiceException("操作失败");
|
throw new ServiceException("操作失败");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user