mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
redis分布式锁(基于注解形势)。
This commit is contained in:
@ -0,0 +1,27 @@
|
||||
package com.ruoyi.common.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 分布式锁(注解模式,不推荐使用,最好用锁的工具类)
|
||||
*/
|
||||
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface RedisLock {
|
||||
|
||||
/**
|
||||
* 锁过期时间
|
||||
* @return
|
||||
*/
|
||||
int expireTime() default 30;//30秒
|
||||
|
||||
/**
|
||||
* 锁key值
|
||||
* @return
|
||||
*/
|
||||
String key() default "redisLockKey";
|
||||
}
|
Reference in New Issue
Block a user