Update RedisLock.java

cyj
pbvfus8to 8 months ago
parent 5033a73603
commit ecc63969ca

@ -14,35 +14,42 @@ import java.lang.annotation.*;
import java.util.concurrent.TimeUnit;
/**
* 使redis
* `RedisLock`使Redis线访
* 使访便
* Redis
*
* @author lanhai
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Target(ElementType.METHOD) // 表明该注解可以应用在方法上,意味着只能将这个注解标记在方法声明处,用于对方法添加分布式锁相关的配置。
@Retention(RetentionPolicy.RUNTIME) // 指定注解的保留策略为运行时,即在运行时可以通过反射等机制获取到该注解的相关信息,从而根据注解配置来实现分布式锁的逻辑。
@Documented // 表示该注解会被包含在生成的JavaDoc文档中方便开发人员查看和了解该注解的相关信息。
public @interface RedisLock {
/**
* redis
*/
String lockName() default "";
/**
* redisRedis便Redis
* 使使 "orderService_createOrder_lock"
*/
String lockName() default "";
/**
* redis key spel
*/
String key() default "";
/**
* rediskeyspelkeyRedisspelSpring Expression Language
* 使ID "#orderId" spelID使
*/
String key() default "";
/**
* ,5
*
* @return
*/
int expire() default 5000;
/**
* Redis `expire` `TimeUnit` 50005
*
*
* @return 便使
*/
int expire() default 5000;
/**
*
*
* @return
*/
TimeUnit timeUnit() default TimeUnit.MILLISECONDS;
}
/**
* `expire` `TimeUnit.MILLISECONDS` `expire`
* `expire`
*
* @return `TimeUnit` `expire` `expire` 使
*/
TimeUnit timeUnit() default TimeUnit.MILLISECONDS;
}
Loading…
Cancel
Save