¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.controller; |
| | | |
| | | import com.ruoyi.common.annotation.RateLimiter; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | |
| | | /** |
| | | * æµè¯åå¸å¼éæµæ ·ä¾ |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | @Api(value = "æµè¯åå¸å¼éæµæ ·ä¾", tags = {"æµè¯åå¸å¼éæµæ ·ä¾"}) |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/demo/rateLimiter") |
| | | public class RedisRateLimiterController { |
| | | |
| | | /** |
| | | * æµè¯éæµæ³¨è§£ |
| | | */ |
| | | @ApiOperation("æµè¯éæµæ³¨è§£") |
| | | @RateLimiter(count = 2, time = 10) |
| | | @GetMapping("/test") |
| | | public AjaxResult<String> test(String value){ |
| | | return AjaxResult.success("æä½æå",value); |
| | | } |
| | | |
| | | } |