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