diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/SystemPackageCacheSupport.java b/src/main/java/au/com/royalpay/payment/manage/system/core/SystemPackageCacheSupport.java new file mode 100644 index 000000000..ec61f69bf --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/system/core/SystemPackageCacheSupport.java @@ -0,0 +1,17 @@ +package au.com.royalpay.payment.manage.system.core; + +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.stereotype.Service; + +/** + * @author kira + * @date 2018/7/5 + */ +@Service +public class SystemPackageCacheSupport { + + @CacheEvict(value = ":system:client_permission:", key = "#clientMoniker") + public void clearClientPermission(String client_moniker){ + + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/PermissionClientModulesServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/system/core/impl/PermissionClientModulesServiceImpl.java index d43cae9af..b74459011 100644 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/PermissionClientModulesServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/system/core/impl/PermissionClientModulesServiceImpl.java @@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.system.core.impl; import au.com.royalpay.payment.manage.mappers.system.SysPermissionClientModulesMapper; import au.com.royalpay.payment.manage.system.core.PermissionClientModulesService; +import au.com.royalpay.payment.manage.system.core.SystemPackageCacheSupport; import au.com.royalpay.payment.manage.system.core.beans.PermissionClientModuleLog; import au.com.royalpay.payment.tools.exceptions.NotFoundException; import au.com.royalpay.payment.tools.utils.id.IdUtil; @@ -32,6 +33,8 @@ public class PermissionClientModulesServiceImpl implements PermissionClientModul @Resource private MongoTemplate mongoTemplate; + @Resource + private SystemPackageCacheSupport systemPackageCacheSupport; @Override @@ -62,6 +65,7 @@ public class PermissionClientModulesServiceImpl implements PermissionClientModul saveMongoLog(account,record,updateRecord,(isValid?"打开":"关闭")+"模块 id:"+record.getString("module_id")); updateRecord.put("id", record.getLong("id")); permissionClientModulesMapper.update(updateRecord); + systemPackageCacheSupport.clearClientPermission(record.getString("client_moniker")); }