docs 补充项目注释
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
<artifactId>ruoyi-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 序列化模块 -->
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-json</artifactId>
|
||||
@@ -33,32 +34,38 @@
|
||||
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Redisson 缓存 -->
|
||||
<dependency>
|
||||
<groupId>org.redisson</groupId>
|
||||
<artifactId>redisson-spring-cache</artifactId>
|
||||
<version>${redisson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 分布式锁 -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>lock4j-redisson-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 本地缓存 -->
|
||||
<dependency>
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
<artifactId>caffeine</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Jackson Databind -->
|
||||
<dependency>
|
||||
<groupId>tools.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Hutool 加密工具 -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-crypto</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Sa-Token 核心 -->
|
||||
<dependency>
|
||||
<groupId>cn.dev33</groupId>
|
||||
<artifactId>sa-token-core</artifactId>
|
||||
|
||||
+3
@@ -19,6 +19,9 @@ public @interface RepeatSubmit {
|
||||
*/
|
||||
int interval() default 5000;
|
||||
|
||||
/**
|
||||
* 重复提交间隔时间单位。
|
||||
*/
|
||||
TimeUnit timeUnit() default TimeUnit.MILLISECONDS;
|
||||
|
||||
/**
|
||||
|
||||
+6
@@ -50,6 +50,12 @@ public class RateLimiterAspect {
|
||||
private final ParameterNameDiscoverer pnd = new DefaultParameterNameDiscoverer();
|
||||
|
||||
|
||||
/**
|
||||
* 在限流注解方法执行前扣减令牌,令牌不足时阻断请求。
|
||||
*
|
||||
* @param point 切点信息
|
||||
* @param rateLimiter 限流注解配置
|
||||
*/
|
||||
@Before("@annotation(rateLimiter)")
|
||||
public void doBefore(JoinPoint point, RateLimiter rateLimiter) {
|
||||
int time = rateLimiter.time();
|
||||
|
||||
+5
@@ -13,6 +13,11 @@ import org.springframework.data.redis.connection.RedisConfiguration;
|
||||
@AutoConfiguration(after = RedisConfiguration.class)
|
||||
public class IdempotentConfig {
|
||||
|
||||
/**
|
||||
* 创建重复提交切面。
|
||||
*
|
||||
* @return 重复提交切面
|
||||
*/
|
||||
@Bean
|
||||
public RepeatSubmitAspect repeatSubmitAspect() {
|
||||
return new RepeatSubmitAspect();
|
||||
|
||||
+7
@@ -6,12 +6,19 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.data.redis.connection.RedisConfiguration;
|
||||
|
||||
/**
|
||||
* 限流功能配置。
|
||||
*
|
||||
* @author guangxin
|
||||
* @date 2023/1/18
|
||||
*/
|
||||
@AutoConfiguration(after = RedisConfiguration.class)
|
||||
public class RateLimiterConfig {
|
||||
|
||||
/**
|
||||
* 创建限流切面。
|
||||
*
|
||||
* @return 限流切面
|
||||
*/
|
||||
@Bean
|
||||
public RateLimiterAspect rateLimiterAspect() {
|
||||
return new RateLimiterAspect();
|
||||
|
||||
Reference in New Issue
Block a user