Files
xiu_b/src/main/java/com/tailbet/util/RedisLock.java
T
2026-08-05 13:48:48 +08:00

33 lines
519 B
Java

package com.tailbet.util;
import java.lang.annotation.*;
/**
* Redis分布式锁注解
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RedisLock {
/**
* 锁的key,支持SpEL表达式
*/
String key();
/**
* 锁过期时间(秒)
*/
int expire() default 30;
/**
* 是否等待锁
*/
boolean waitLock() default false;
/**
* 等待锁的最大时间(毫秒)
*/
long waitTime() default 3000;
}