修改注入方式
This commit is contained in:
@@ -7,6 +7,7 @@ import org.aspectj.lang.ProceedingJoinPoint;
|
|||||||
import org.aspectj.lang.annotation.Around;
|
import org.aspectj.lang.annotation.Around;
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.aspectj.lang.reflect.MethodSignature;
|
import org.aspectj.lang.reflect.MethodSignature;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.DefaultParameterNameDiscoverer;
|
import org.springframework.core.DefaultParameterNameDiscoverer;
|
||||||
import org.springframework.expression.EvaluationContext;
|
import org.springframework.expression.EvaluationContext;
|
||||||
import org.springframework.expression.Expression;
|
import org.springframework.expression.Expression;
|
||||||
@@ -25,12 +26,9 @@ import org.springframework.expression.spel.support.StandardEvaluationContext;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Aspect
|
@Aspect
|
||||||
public class LockAspect {
|
public class LockAspect {
|
||||||
|
@Autowired(required = false)
|
||||||
private DistributedLock locker;
|
private DistributedLock locker;
|
||||||
|
|
||||||
public LockAspect(DistributedLock locker) {
|
|
||||||
this.locker = locker;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于SpEL表达式解析.
|
* 用于SpEL表达式解析.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user