@Before(value = "authServicePointcut() && authCacheEvictAllOrSpecialPointcut(arg)", argNames = "jp,arg")
public void authCacheClearSpecialOrAllAdvice(JoinPoint jp, Object arg) {
log.debug("cacheName:{}, method:authCacheClearSpecialOrAllAdvice begin", cacheName);
String methodName = jp.getSignature().getName();
if (arg instanceof Auth) {//只清除某个用户的即可
Auth auth = (Auth) arg;
log.debug("cacheName:{}, method:authCacheClearSpecialOrAllAdvice delegate to evictWithAuth", cacheName);
evictWithAuth(auth);
} else if ("delete".equals(methodName)) { //删除方法
if (arg instanceof Long) { //删除单个
Long authId = (Long) arg;
Auth auth = authService.findOne(authId);
log.debug("cacheName:{}, method:authCacheClearSpecialOrAllAdvice delegate to evictWithAuth", cacheName);
evictWithAuth(auth);
} else if (arg instanceof Long[]) { //批量删除
for (Long authId : ((Long[]) arg)) {
Auth auth = authService.findOne(authId);
log.debug("cacheName:{}, method:authCacheClearSpecialOrAllAdvice delegate to evictWithAuth", cacheName);
if (evictWithAuth(auth)) {//如果清空的是所有 直接返回
return;
}