add cache clearing

master
wangning 6 years ago
parent 6c752a3e0b
commit cd50cbf719

@ -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){
}
}

@ -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"));
}

Loading…
Cancel
Save