mirror of
https://github.com/BgaSol/sol-cloud
synced 2026-05-24 09:38:21 +00:00
refactor(common-base-web): Optimize cache deletion logic
This commit is contained in:
parent
e6b2a76bef
commit
05afb9afb6
1 changed files with 1 additions and 1 deletions
|
|
@ -94,7 +94,6 @@ public abstract class BaseService<ENTITY extends BaseEntity, PAGE_DTO extends Ba
|
|||
}
|
||||
// 插入实体
|
||||
commonBaseMapper().insert(entity);
|
||||
cacheDelete(entity.getId());
|
||||
if (ObjectUtils.isNotEmpty(commonBaseRedissonClient())) {
|
||||
// 清理缓存
|
||||
String key = serviceName + ":" + entity.getClass().getName();
|
||||
|
|
@ -141,6 +140,7 @@ public abstract class BaseService<ENTITY extends BaseEntity, PAGE_DTO extends Ba
|
|||
* @return 实体
|
||||
*/
|
||||
public ENTITY update(ENTITY entity) {
|
||||
this.cacheDelete(entity.getId());
|
||||
ENTITY queryEntity = cacheSearch(entity.getId());
|
||||
if (queryEntity == null) {
|
||||
throw new BaseException("更新失败,更新数据不存在");
|
||||
|
|
|
|||
Loading…
Reference in a new issue