public interface IFrequencyCheckerService
限定符和类型 | 方法和说明 |
---|---|
void |
dayCheck(String key,
String scene,
int maxCounts)
每天,某个key,在某个场景下,被调用的次数检查,超过最大次数时抛出异常
|
void |
dayCheck(String key,
String scene,
int maxCounts,
int increment)
每天,某个key,在某个场景下,被调用的次数检查,超过最大次数时抛出异常
|
void |
frequencyChecker(String key,
String scene,
int maxDayCounts,
int maxHourCounts,
int maxMinuteCounts)
按照指定策略执行频率检查
|
void |
hourCheck(String key,
String scene,
int maxCounts)
每小时,某个key,在某个场景下,被调用的次数检查,超过最大次数时抛出异常
|
void |
hourCheck(String key,
String scene,
int maxCounts,
int increment)
每小时,某个key,在某个场景下,被调用的次数检查,超过最大次数时抛出异常
|
void |
minuteCheck(String key,
String scene,
int maxCounts)
每分钟,某个key,在某个场景下,被调用的次数检查,超过最大次数时抛出异常
|
void |
minuteCheck(String key,
String scene,
int maxCounts,
int increment)
每分钟,某个key,在某个场景下,被调用的次数检查,超过最大次数时抛出异常
|
void |
timeCheck(String key,
String scene,
int maxCounts,
int time)
指定时间内,某个key,在某个场景下,被调用的次数检查,超过最大次数时抛出异常
|
void |
timeCheck(String key,
String scene,
int maxCounts,
int increment,
int time)
指定时间内,某个key,在某个场景下,被调用的次数检查,超过最大次数时抛出异常
|
void dayCheck(String key, String scene, int maxCounts) throws ExceedMaxTimesOneDayException
key
- 某个主体标识scene
- 某个场景,比如注册,登录maxCounts
- 一天内允许的最大次数ExceedMaxTimesOneDayException
void dayCheck(String key, String scene, int maxCounts, int increment) throws ExceedMaxTimesOneDayException
key
- 某个主体标识scene
- 某个场景,比如注册,登录maxCounts
- 一天内允许的最大次数increment
- 每调用一次,计数的增量,默认是1ExceedMaxTimesOneDayException
void hourCheck(String key, String scene, int maxCounts) throws ExceedMaxTimesOneHourException
key
- 某个主体标识scene
- 某个场景,比如注册,登录maxCounts
- 一小时内允许的最大次数ExceedMaxTimesOneHourException
void hourCheck(String key, String scene, int maxCounts, int increment) throws ExceedMaxTimesOneHourException
key
- 某个主体标识scene
- 某个场景,比如注册,登录maxCounts
- 一小时内允许的最大次数increment
- 每调用一次,计数的增量,默认是1ExceedMaxTimesOneHourException
void minuteCheck(String key, String scene, int maxCounts) throws ExceedMaxTimesOneMinuteException
key
- 某个主体标识scene
- 某个场景,比如注册,登录maxCounts
- 一分钟内允许的最大调用次数ExceedMaxTimesOneMinuteException
void minuteCheck(String key, String scene, int maxCounts, int increment) throws ExceedMaxTimesOneMinuteException
key
- 某个主体标识scene
- 某个场景,比如注册,登录maxCounts
- 一分钟内允许的最大调用次数increment
- 每调用一次,计数的增量,默认是1ExceedMaxTimesOneMinuteException
void timeCheck(String key, String scene, int maxCounts, int time) throws FrequencyRuntimeException
key
- 某个主体标识scene
- 某个场景,比如注册,登录maxCounts
- 指定时间内允许的最大调用次数time
- 指定时间,秒为单位FrequencyRuntimeException
void timeCheck(String key, String scene, int maxCounts, int increment, int time) throws FrequencyRuntimeException
key
- 某个主体标识scene
- 某个场景,比如注册,登录maxCounts
- 指定时间内允许的最大调用次数increment
- 每调用一次,计数的增量,默认是1time
- 指定时间,秒为单位FrequencyRuntimeException