-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ce02df
commit 5ae9285
Showing
9 changed files
with
142 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...xt/src/main/java/com/giffing/bucket4j/spring/boot/starter/context/IgnoreRateLimiting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.giffing.bucket4j.spring.boot.starter.context; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Ignores the rate limiting annotation for a class or method | ||
*/ | ||
@Target(value = { ElementType.TYPE, ElementType.METHOD }) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface IgnoreRateLimiting { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...esources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
com.giffing.bucket4j.spring.boot.starter.config.cache.Bucket4jCacheConfiguration | ||
com.giffing.bucket4j.spring.boot.starter.config.aspect.AopConfig | ||
com.giffing.bucket4j.spring.boot.starter.config.aspect.Bucket4jAopConfig | ||
com.giffing.bucket4j.spring.boot.starter.config.filter.reactive.gateway.Bucket4JAutoConfigurationSpringCloudGatewayFilter | ||
com.giffing.bucket4j.spring.boot.starter.config.filter.servlet.Bucket4JAutoConfigurationServletFilter | ||
com.giffing.bucket4j.spring.boot.starter.config.filter.reactive.webflux.Bucket4JAutoConfigurationWebfluxFilter |
22 changes: 22 additions & 0 deletions
22
...ffing/bucket4j/spring/boot/starter/general/tests/method/method/ClassLevelTestService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.giffing.bucket4j.spring.boot.starter.general.tests.method.method; | ||
|
||
import com.giffing.bucket4j.spring.boot.starter.context.IgnoreRateLimiting; | ||
import com.giffing.bucket4j.spring.boot.starter.context.RateLimiting; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@Slf4j | ||
@RateLimiting(name = "default") | ||
public class ClassLevelTestService { | ||
|
||
public void notAnnotatedMethod() { | ||
log.info("Method notAnnotatedMethod"); | ||
} | ||
|
||
@IgnoreRateLimiting | ||
public void ignoreMethod() { | ||
log.info("Method ignoreMethod"); | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
...cket4j/spring/boot/starter/general/tests/method/method/IgnoreOnClassLevelTestService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.giffing.bucket4j.spring.boot.starter.general.tests.method.method; | ||
|
||
import com.giffing.bucket4j.spring.boot.starter.context.IgnoreRateLimiting; | ||
import com.giffing.bucket4j.spring.boot.starter.context.RateLimiting; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@Slf4j | ||
@IgnoreRateLimiting | ||
public class IgnoreOnClassLevelTestService { | ||
|
||
@RateLimiting(name = "default") | ||
public void execute() { | ||
log.info("Method execute"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters