¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, DreamLu All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: DreamLu 墿¥æ¢¦ (596392912@qq.com) |
| | | */ |
| | | |
| | | package org.springblade.core.redis.ratelimiter; |
| | | |
| | | import java.lang.annotation.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * åå¸å¼ éæµæ³¨è§£ï¼é»è®¤éç为 600/ms |
| | | * |
| | | * @author L.cm |
| | | */ |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target(ElementType.METHOD) |
| | | @Documented |
| | | public @interface RateLimiter { |
| | | |
| | | /** |
| | | * éæµç key æ¯æï¼å¿
é¡»ï¼è¯·ä¿æå¯ä¸æ§ |
| | | * |
| | | * @return key |
| | | */ |
| | | String value(); |
| | | |
| | | /** |
| | | * éæµçåæ°ï¼å¯éï¼æ¯æ spring el # è¯»åæ¹æ³åæ°å @ 读å spring bean |
| | | * |
| | | * @return param |
| | | */ |
| | | String param() default ""; |
| | | |
| | | /** |
| | | * æ¯æçæå¤§è¯·æ±ï¼é»è®¤: 100 |
| | | * |
| | | * @return è¯·æ±æ° |
| | | */ |
| | | long max() default 100L; |
| | | |
| | | /** |
| | | * æç»æ¶é´ï¼é»è®¤: 3600 |
| | | * |
| | | * @return æç»æ¶é´ |
| | | */ |
| | | long ttl() default 1L; |
| | | |
| | | /** |
| | | * æ¶é´åä½ï¼é»è®¤ä¸ºå |
| | | * |
| | | * @return TimeUnit |
| | | */ |
| | | TimeUnit timeUnit() default TimeUnit.MINUTES; |
| | | } |