12345678910111213141516171819202122232425262728293031323334353637 |
- package com.fdkankan.openApi.component;
- import com.fdkankan.openApi.constant.LimitType;
- import java.lang.annotation.*;
- import java.util.concurrent.TimeUnit;
- @Target({ElementType.METHOD,ElementType.TYPE})
- @Retention(RetentionPolicy.RUNTIME)
- @Inherited
- @Documented
- public @interface RedisLimit {
- // 资源名称
- String name() default "";
- // 资源key
- String key() default "";
- /**
- * 滑动窗口时间单位,默认 分钟
- */
- TimeUnit timeUnit() default TimeUnit.SECONDS;
- // 时间
- int period();
- // 最多访问次数
- int limitCount();
- // 类型
- LimitType limitType() default LimitType.APP_KEY;
- // 提示信息
- String msg() default "系统繁忙,请稍后再试";
- }
|