xiaoyong931011
2022-09-22 d040c0f42d6799e2a89ea2dcbd5e3b0f97bffc2a
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
package cc.mrbird.febs.common.annotation;
 
 
import cc.mrbird.febs.common.entity.LimitType;
 
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
 
/**
 * @author MrBird
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Limit {
 
    /**
     * 资源名称,用于描述接口功能
     */
    String name() default "";
 
    /**
     * 资源 key
     */
    String key() default "";
 
    /**
     * key prefix
     */
    String prefix() default "";
 
    /**
     * 时间范围,单位秒
     */
    int period();
 
    /**
     * 限制访问次数
     */
    int count();
 
    /**
     * 限制类型
     */
    LimitType limitType() default LimitType.CUSTOMER;
}