RedisLock.java 548 B

123456789101112131415161718192021222324252627
  1. package com.ruoyi.common.annotation;
  2. import java.lang.annotation.ElementType;
  3. import java.lang.annotation.Retention;
  4. import java.lang.annotation.RetentionPolicy;
  5. import java.lang.annotation.Target;
  6. /**
  7. * 分布式锁(注解模式,不推荐使用,最好用锁的工具类)
  8. *
  9. * @author shenxinquan
  10. */
  11. @Target({ElementType.METHOD})
  12. @Retention(RetentionPolicy.RUNTIME)
  13. public @interface RedisLock {
  14. /**
  15. * 锁过期时间 默认30秒
  16. */
  17. int expireTime() default 30;
  18. /**
  19. * 锁key值
  20. */
  21. String key() default "redisLockKey";
  22. }