mirror of
https://github.com/BgaSol/sol-cloud
synced 2026-05-05 23:58:33 +00:00
fix(service): Fix cache update logic
This commit is contained in:
parent
05afb9afb6
commit
97ba7cffaf
2 changed files with 1 additions and 2 deletions
|
|
@ -140,7 +140,6 @@ 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("更新失败,更新数据不存在");
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public class PermissionService extends BaseService<PermissionEntity, BasePageDto
|
|||
this.update(parentPermission);
|
||||
}
|
||||
for (PermissionEntity permission : parentPermission.getChildren()) {
|
||||
if (this.cacheSearch(parentPermission.getId()) == null) {
|
||||
if (this.cacheSearch(permission.getId()) == null) {
|
||||
this.save(permission);
|
||||
} else {
|
||||
this.update(permission);
|
||||
|
|
|
|||
Loading…
Reference in a new issue