提交 fdcbe775 编写于 作者: zlt2000's avatar zlt2000

修复@Lock注解解锁报错

上级 1a537789
......@@ -65,6 +65,8 @@ public interface DistributedLock {
* @param zLock 锁抽象对象
*/
default void unlock(ZLock zLock) throws Exception {
this.unlock(zLock.getLock());
if (zLock != null) {
this.unlock(zLock.getLock());
}
}
}
......@@ -40,7 +40,6 @@ public class LockAspect {
@Around("@within(lock) || @annotation(lock)")
public Object aroundLock(ProceedingJoinPoint point, Lock lock) throws Throwable {
Object lockObj = null;
if (lock == null) {
// 获取类上的注解
lock = point.getTarget().getClass().getDeclaredAnnotation(Lock.class);
......@@ -59,6 +58,7 @@ public class LockAspect {
Object[] args = point.getArgs();
lockKey = getValBySpEL(lockKey, methodSignature, args);
}
ZLock lockObj = null;
try {
//加锁
if (lock.waitTime() > 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册