mirror of
https://github.com/BgaSol/sol-cloud
synced 2026-05-24 09:38:21 +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 实体
|
* @return 实体
|
||||||
*/
|
*/
|
||||||
public ENTITY update(ENTITY entity) {
|
public ENTITY update(ENTITY entity) {
|
||||||
this.cacheDelete(entity.getId());
|
|
||||||
ENTITY queryEntity = cacheSearch(entity.getId());
|
ENTITY queryEntity = cacheSearch(entity.getId());
|
||||||
if (queryEntity == null) {
|
if (queryEntity == null) {
|
||||||
throw new BaseException("更新失败,更新数据不存在");
|
throw new BaseException("更新失败,更新数据不存在");
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ public class PermissionService extends BaseService<PermissionEntity, BasePageDto
|
||||||
this.update(parentPermission);
|
this.update(parentPermission);
|
||||||
}
|
}
|
||||||
for (PermissionEntity permission : parentPermission.getChildren()) {
|
for (PermissionEntity permission : parentPermission.getChildren()) {
|
||||||
if (this.cacheSearch(parentPermission.getId()) == null) {
|
if (this.cacheSearch(permission.getId()) == null) {
|
||||||
this.save(permission);
|
this.save(permission);
|
||||||
} else {
|
} else {
|
||||||
this.update(permission);
|
this.update(permission);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue