中国算力平台算力登记系统2.0
yanzhaofeige
6 days ago 346e19ed91e10ac14722fcc29dbb810b9d971d3d
commit | author | age
43dc29 1 package com.odcc.cpzidc.common.annotation;
Y 2
3 import java.lang.annotation.Documented;
4 import java.lang.annotation.ElementType;
5 import java.lang.annotation.Retention;
6 import java.lang.annotation.RetentionPolicy;
7 import java.lang.annotation.Target;
8 import com.odcc.cpzidc.common.constant.CacheConstants;
9 import com.odcc.cpzidc.common.enums.LimitType;
10
11 /**
12  * 限流注解
13  * 
14  * @author ruoyi
15  */
16 @Target(ElementType.METHOD)
17 @Retention(RetentionPolicy.RUNTIME)
18 @Documented
19 public @interface RateLimiter
20 {
21     /**
22      * 限流key
23      */
24     public String key() default CacheConstants.RATE_LIMIT_KEY;
25
26     /**
27      * 限流时间,单位秒
28      */
29     public int time() default 60;
30
31     /**
32      * 限流次数
33      */
34     public int count() default 100;
35
36     /**
37      * 限流类型
38      */
39     public LimitType limitType() default LimitType.DEFAULT;
40 }