123456789101112131415161718192021222324252627282930313233343536 |
- package com.zhjq.common.annotation;
- import com.zhjq.common.constant.CacheConstants;
- import com.zhjq.common.enums.LimitType;
- import java.lang.annotation.*;
- /**
- * 限流注解
- *
- * @author ruoyi
- */
- @Target(ElementType.METHOD)
- @Retention(RetentionPolicy.RUNTIME)
- @Documented
- public @interface RateLimiter {
- /**
- * 限流key
- */
- public String key() default CacheConstants.RATE_LIMIT_KEY;
- /**
- * 限流时间,单位秒
- */
- public int time() default 60;
- /**
- * 限流次数
- */
- public int count() default 100;
- /**
- * 限流类型
- */
- public LimitType limitType() default LimitType.DEFAULT;
- }
|