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

com.github.xuchen93.web.annotation.RedisLimit Maven / Gradle / Ivy

There is a newer version: 1.1.3
Show newest version
package com.github.xuchen93.web.annotation;

import com.github.xuchen93.web.enums.LimitType;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;

@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface RedisLimit {

	/**
	 * key
	 */
	String key() default "";

	/**
	 * 时间值
	 */
	int period();

	/**
	 * 时间范围
	 */
	TimeUnit timeunit();

	/**
	 * 一定时间内最多访问次数
	 */
	int count();

	/**
	 * 限流的依据
	 */
	LimitType limitType() default LimitType.IP;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy