add common 依赖 spring-boot-properties-migrator ;
add 新增 modules 模块, 包含 demo, generator, job, system 模块 ; update 更新模块包名 rateLimiter => ratelimiter ; refactor 重构 ratelimiter 模块, 参考幂等模块加入自动装配相关配置 ; fix 修正 AsyncConfig 实现接口 ; fix 修正 SwaggerConfig 注解写法 ; fix 修正 ruoyi-common-doc pom 描述 ; delete LogAspect 去掉无用注解 ;
This commit is contained in:
parent
71a2a8245d
commit
2ae3681286
62
pom.xml
62
pom.xml
@ -285,74 +285,14 @@
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<version>${snakeyaml.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 定时任务 -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-job</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 代码生成-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-generator</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 核心模块-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-framework</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 系统模块-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-system</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- OSS对象存储模块 -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-oss</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- SMS短信模块 -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-sms</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- demo模块 -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-demo</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<modules>
|
||||
<module>ruoyi-admin</module>
|
||||
<module>ruoyi-system</module>
|
||||
<module>ruoyi-job</module>
|
||||
<module>ruoyi-generator</module>
|
||||
<module>ruoyi-common</module>
|
||||
<module>ruoyi-demo</module>
|
||||
<module>ruoyi-extend</module>
|
||||
<module>ruoyi-modules</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
<module>ruoyi-common-mail</module>
|
||||
<module>ruoyi-common-mybatis</module>
|
||||
<module>ruoyi-common-oss</module>
|
||||
<module>ruoyi-common-rateLimiter</module>
|
||||
<module>ruoyi-common-ratelimiter</module>
|
||||
<module>ruoyi-common-redis</module>
|
||||
<module>ruoyi-common-satoken</module>
|
||||
<module>ruoyi-common-security</module>
|
||||
|
@ -85,7 +85,7 @@
|
||||
<!-- 限流 -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-rateLimiter</artifactId>
|
||||
<artifactId>ruoyi-common-ratelimiter</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
|
@ -104,6 +104,12 @@
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-properties-migrator</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
@ -6,7 +6,7 @@ import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.scheduling.annotation.AsyncConfigurerSupport;
|
||||
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
import java.util.Arrays;
|
||||
@ -20,7 +20,7 @@ import java.util.concurrent.ScheduledExecutorService;
|
||||
*/
|
||||
@EnableAsync(proxyTargetClass = true)
|
||||
@AutoConfiguration
|
||||
public class AsyncConfig extends AsyncConfigurerSupport {
|
||||
public class AsyncConfig implements AsyncConfigurer {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("scheduledExecutorService")
|
||||
|
@ -194,7 +194,7 @@ public class BeanCopyUtils {
|
||||
private String genKey(Class<?> srcClass, Class<?> targetClass, Converter converter) {
|
||||
final StringBuilder key = StrUtil.builder()
|
||||
.append(srcClass.getName()).append('#').append(targetClass.getName());
|
||||
if(null != converter){
|
||||
if (null != converter) {
|
||||
key.append('#').append(converter.getClass().getName());
|
||||
}
|
||||
return key.toString();
|
||||
|
@ -13,7 +13,7 @@
|
||||
<artifactId>ruoyi-common-doc</artifactId>
|
||||
|
||||
<description>
|
||||
ruoyi-common-swagger 系统接口
|
||||
ruoyi-common-doc 系统接口
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
@ -17,7 +17,7 @@ import org.springdoc.core.providers.JavadocProvider;
|
||||
import org.springdoc.core.service.OpenAPIService;
|
||||
import org.springdoc.core.service.SecurityService;
|
||||
import org.springdoc.core.utils.PropertyResolverUtils;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
||||
@ -34,7 +34,7 @@ import java.util.Set;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@AutoConfigureBefore(SpringDocConfiguration.class)
|
||||
@AutoConfiguration(before = SpringDocConfiguration.class)
|
||||
@ConditionalOnProperty(name = "swagger.enabled", havingValue = "true", matchIfMissing = true)
|
||||
public class SwaggerConfig {
|
||||
|
||||
@ -105,7 +105,7 @@ public class SwaggerConfig {
|
||||
return;
|
||||
}
|
||||
PlusPaths newPaths = new PlusPaths();
|
||||
oldPaths.forEach((k,v) -> newPaths.addPathItem(finalContextPath + k, v));
|
||||
oldPaths.forEach((k, v) -> newPaths.addPathItem(finalContextPath + k, v));
|
||||
openApi.setPaths(newPaths);
|
||||
};
|
||||
}
|
||||
|
@ -18,7 +18,6 @@ import org.aspectj.lang.annotation.AfterThrowing;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@ -34,7 +33,6 @@ import java.util.Map;
|
||||
*/
|
||||
@Slf4j
|
||||
@Aspect
|
||||
@Component
|
||||
@AutoConfiguration
|
||||
public class LogAspect {
|
||||
|
||||
|
@ -10,10 +10,10 @@
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ruoyi-common-rateLimiter</artifactId>
|
||||
<artifactId>ruoyi-common-ratelimiter</artifactId>
|
||||
|
||||
<description>
|
||||
ruoyi-common-rateLimiter 限流功能
|
||||
ruoyi-common-ratelimiter 限流功能
|
||||
</description>
|
||||
|
||||
<dependencies>
|
@ -1,7 +1,7 @@
|
||||
package com.ruoyi.common.rateLimiter.annotation;
|
||||
package com.ruoyi.common.ratelimiter.annotation;
|
||||
|
||||
import com.ruoyi.common.core.constant.CacheConstants;
|
||||
import com.ruoyi.common.rateLimiter.enums.LimitType;
|
||||
import com.ruoyi.common.ratelimiter.enums.LimitType;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.ruoyi.common.rateLimiter.aspectj;
|
||||
package com.ruoyi.common.ratelimiter.aspectj;
|
||||
|
||||
import com.ruoyi.common.core.exception.ServiceException;
|
||||
import com.ruoyi.common.core.utils.MessageUtils;
|
||||
import com.ruoyi.common.core.utils.ServletUtils;
|
||||
import com.ruoyi.common.rateLimiter.annotation.RateLimiter;
|
||||
import com.ruoyi.common.rateLimiter.enums.LimitType;
|
||||
import com.ruoyi.common.ratelimiter.annotation.RateLimiter;
|
||||
import com.ruoyi.common.ratelimiter.enums.LimitType;
|
||||
import com.ruoyi.common.redis.utils.RedisUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
@ -12,7 +12,6 @@ import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.redisson.api.RateType;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@ -23,7 +22,6 @@ import java.lang.reflect.Method;
|
||||
*/
|
||||
@Slf4j
|
||||
@Aspect
|
||||
@Component
|
||||
public class RateLimiterAspect {
|
||||
|
||||
@Before("@annotation(rateLimiter)")
|
@ -0,0 +1,20 @@
|
||||
package com.ruoyi.common.ratelimiter.config;
|
||||
|
||||
import com.ruoyi.common.ratelimiter.aspectj.RateLimiterAspect;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
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 {
|
||||
|
||||
@Bean
|
||||
public RateLimiterAspect rateLimiterAspect() {
|
||||
return new RateLimiterAspect();
|
||||
}
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.ruoyi.common.rateLimiter.enums;
|
||||
package com.ruoyi.common.ratelimiter.enums;
|
||||
|
||||
/**
|
||||
* 限流类型
|
@ -0,0 +1 @@
|
||||
com.ruoyi.common.ratelimiter.config.RateLimiterConfig
|
27
ruoyi-modules/pom.xml
Normal file
27
ruoyi-modules/pom.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi-vue-plus</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<modules>
|
||||
<module>ruoyi-demo</module>
|
||||
<module>ruoyi-generator</module>
|
||||
<module>ruoyi-job</module>
|
||||
<module>ruoyi-system</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<description>
|
||||
ruoyi-modules 业务模块
|
||||
</description>
|
||||
|
||||
</project>
|
@ -3,8 +3,8 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi-vue-plus</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
@ -17,7 +17,6 @@
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
@ -57,7 +56,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-rateLimiter</artifactId>
|
||||
<artifactId>ruoyi-common-ratelimiter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 短信 用哪个导入哪个依赖 -->
|
@ -1,8 +1,8 @@
|
||||
package com.ruoyi.demo.controller;
|
||||
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.rateLimiter.annotation.RateLimiter;
|
||||
import com.ruoyi.common.rateLimiter.enums.LimitType;
|
||||
import com.ruoyi.common.ratelimiter.annotation.RateLimiter;
|
||||
import com.ruoyi.common.ratelimiter.enums.LimitType;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
@ -3,8 +3,8 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi-vue-plus</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
@ -13,7 +13,7 @@
|
||||
<artifactId>ruoyi-generator</artifactId>
|
||||
|
||||
<description>
|
||||
generator代码生成
|
||||
generator 代码生成
|
||||
</description>
|
||||
|
||||
<dependencies>
|
@ -1,10 +1,10 @@
|
||||
# 代码生成
|
||||
gen:
|
||||
# 作者
|
||||
author: ruoyi
|
||||
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
|
||||
packageName: com.ruoyi.system
|
||||
# 自动去除表前缀,默认是false
|
||||
autoRemovePre: false
|
||||
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
|
||||
# 代码生成
|
||||
gen:
|
||||
# 作者
|
||||
author: ruoyi
|
||||
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
|
||||
packageName: com.ruoyi.system
|
||||
# 自动去除表前缀,默认是false
|
||||
autoRemovePre: false
|
||||
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
|
||||
tablePrefix: sys_
|
@ -3,8 +3,8 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi-vue-plus</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
@ -3,8 +3,8 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi-vue-plus</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user