1
zj
21 hours ago f658569891db433854221b80f0a9fa99608cff64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
 *
 * https://www.mall4j.com/
 *
 * 未经允许,不可做商业用途!
 *
 * 版权所有,侵权必究!
 */
 
package com.yami.trading.common.annotation;
 
import org.springframework.core.annotation.AliasFor;
 
import java.lang.annotation.*;
import java.util.concurrent.TimeUnit;
 
/**
 * 使用redis进行分布式锁
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RedisLock {
 
    /**
     * redis锁 名字
     */
    String lockName() default "";
 
    /**
     * redis锁 key 支持spel表达式
     */
    String key() default "";
 
    /**
     * 过期秒数,默认为5毫秒
     *
     * @return 轮询锁的时间
     */
    int expire() default 5000;
 
    /**
     * 超时时间单位
     *
     * @return 秒
     */
    TimeUnit timeUnit() default TimeUnit.MILLISECONDS;
}