字典详情编辑、删除优化修复,https://github.com/elunez/eladmin-mp/issues/15
close https://github.com/elunez/eladmin-mp/issues/15
This commit is contained in:
parent
a102ae49d0
commit
277a17cbd3
@ -63,9 +63,10 @@ public class DictDetailServiceImpl extends ServiceImpl<DictDetailMapper, DictDet
|
|||||||
public void update(DictDetail resources) {
|
public void update(DictDetail resources) {
|
||||||
DictDetail dictDetail = getById(resources.getId());
|
DictDetail dictDetail = getById(resources.getId());
|
||||||
resources.setId(dictDetail.getId());
|
resources.setId(dictDetail.getId());
|
||||||
|
// 更新数据
|
||||||
saveOrUpdate(resources);
|
saveOrUpdate(resources);
|
||||||
// 清理缓存
|
// 清理缓存
|
||||||
delCaches(resources);
|
delCaches(dictDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -84,7 +85,7 @@ public class DictDetailServiceImpl extends ServiceImpl<DictDetailMapper, DictDet
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void delCaches(DictDetail dictDetail){
|
public void delCaches(DictDetail dictDetail){
|
||||||
Dict dict = dictMapper.selectById(dictDetail.getDict().getId());
|
Dict dict = dictMapper.selectById(dictDetail.getDictId());
|
||||||
redisUtils.del(CacheKey.DICT_NAME + dict.getName());
|
redisUtils.del(CacheKey.DICT_NAME + dict.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user