Browse Source

spring-boot-demo-ratelimit-guava 完成,测试不同方法限流

pull/1/head
Yangkai.Shen 5 years ago
parent
commit
f10c69f19f
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      spring-boot-demo-ratelimit-guava/src/main/java/com/xkcoding/ratelimit/guava/controller/TestController.java

+ 7
- 0
spring-boot-demo-ratelimit-guava/src/main/java/com/xkcoding/ratelimit/guava/controller/TestController.java View File

@@ -30,4 +30,11 @@ public class TestController {
log.info("【test2】被执行了。。。。。");
return Dict.create().set("msg", "hello,world!").set("description", "我一直都在,卟离卟弃");
}

@RateLimiter(value = 2.0, timeout = 300)
@GetMapping("/test3")
public Dict test3() {
log.info("【test3】被执行了。。。。。");
return Dict.create().set("msg", "hello,world!").set("description", "别想一直看到我,不信你快速刷新看看~");
}
}

Loading…
Cancel
Save