All Downloads are FREE. Search and download functionalities are using the official Maven repository.

wang.ramboll.extend.request.limit.annotation.RequestFrequencyLimit Maven / Gradle / Ivy

There is a newer version: 1.0.4-RC.1
Show newest version
package wang.ramboll.extend.request.limit.annotation;

import wang.ramboll.extend.request.limit.enums.RequestFrequencyLimitMode;

import java.lang.annotation.*;

/**
 * 访问请求频率限制注解
 * @author WangRuibo
 */
@Target({ElementType.METHOD,ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface RequestFrequencyLimit {
    /**
     * 拦截延迟,单位毫秒
     * @return
     */
    long delay() default 1000L;//拦截延迟,单位毫秒

    long maxTimes() default 1;//延迟时间内最大访问数量

    /**
     * 拦截模式配置
     * @return
     */
    RequestFrequencyLimitMode[] limitMode() default {RequestFrequencyLimitMode.URI,RequestFrequencyLimitMode.REQUEST_BODY} ;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy