package com.qianwen.core.tenant.aspect;
|
|
import org.aspectj.lang.ProceedingJoinPoint;
|
import org.aspectj.lang.annotation.Around;
|
import org.aspectj.lang.annotation.Aspect;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import com.qianwen.core.tenant.BladeTenantHolder;
|
import com.qianwen.core.tenant.annotation.TenantIgnore;
|
|
@Aspect
|
|
public class BladeTenantAspect {
|
private static final Logger log = LoggerFactory.getLogger(BladeTenantAspect.class);
|
|
@Around("@annotation(tenantIgnore)")
|
public Object around(ProceedingJoinPoint point, TenantIgnore tenantIgnore) throws Throwable {
|
try {
|
BladeTenantHolder.setIgnore(Boolean.TRUE);
|
Object proceed = point.proceed();
|
BladeTenantHolder.clear();
|
return proceed;
|
} catch (Throwable th) {
|
BladeTenantHolder.clear();
|
throw th;
|
}
|
}
|
}
|