From 76f0ea534e3229e981203e0c19626f641ea46067 Mon Sep 17 00:00:00 2001 From: smallchill Date: Tue, 12 Jul 2022 01:58:20 +0800 Subject: [PATCH] =?UTF-8?q?:tada:=203.4.0.RELEASE=20=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E9=80=82=E9=85=8Dspringboot2.7.1=20=E6=96=B0=E5=A2=9E=E7=81=B0?= =?UTF-8?q?=E5=BA=A6=E6=9C=8D=E5=8A=A1=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 31 +++-- blade-core-boot/pom.xml | 6 +- .../config/BladeBootAutoConfiguration.java | 4 +- .../boot/config/BladeWebMvcConfiguration.java | 4 +- .../core/boot/config/RetryConfiguration.java | 4 +- .../core/boot/logger/RequestLogAspect.java | 4 +- .../core/boot/tenant/TenantConfiguration.java | 4 +- .../src/main/resources/bootstrap.yml | 2 +- .../src/main/resources/log/logback_dev.xml | 2 +- .../src/main/resources/log/logback_prod.xml | 2 +- .../src/main/resources/log/logback_test.xml | 2 +- blade-core-cloud/pom.xml | 4 +- .../config/BladeCloudAutoConfiguration.java | 4 +- .../cloud/http/HttpLoggingInterceptor.java | 5 +- .../cloud/http/RestTemplateConfiguration.java | 4 +- .../VersionMappingAutoConfiguration.java | 4 +- blade-core-datascope/pom.xml | 2 +- .../config/DataScopeConfiguration.java | 4 +- blade-core-develop/pom.xml | 2 +- .../develop/support/BladeCodeGenerator.java | 25 ++-- .../resources/templates/controller.java.vm | 2 +- blade-core-launch/pom.xml | 2 +- .../core/launch/StartEventListener.java | 4 +- .../config/BladeLaunchConfiguration.java | 4 +- .../core/launch/constant/AppConstant.java | 2 +- .../core/launch/server/ServerInfo.java | 4 +- blade-core-loadbalancer/pom.xml | 75 ++++++++++++ .../BladeLoadBalancerConfiguration.java | 61 ++++++++++ .../constant/LoadBalancerConstant.java | 30 +++++ .../props/BladeLoadBalancerProperties.java | 51 ++++++++ .../rule/GrayscaleEnvPostProcessor.java | 49 ++++++++ .../rule/GrayscaleLoadBalancer.java | 114 ++++++++++++++++++ blade-core-log/pom.xml | 2 +- .../BladeErrorMvcAutoConfiguration.java | 4 +- .../config/BladeLogToolAutoConfiguration.java | 14 +-- .../error/BladeRestExceptionTranslator.java | 4 +- blade-core-mybatis/pom.xml | 2 +- .../mp/config/MybatisPlusConfiguration.java | 4 +- blade-core-oss/pom.xml | 2 +- .../core/oss/config/AliossConfiguration.java | 4 +- .../core/oss/config/QiniuConfiguration.java | 4 +- blade-core-report/pom.xml | 2 +- .../report/config/ReportConfiguration.java | 4 +- blade-core-secure/pom.xml | 2 +- .../secure/config/RegistryConfiguration.java | 4 +- .../secure/config/SecureConfiguration.java | 4 +- blade-core-social/pom.xml | 2 +- .../social/config/SocialConfiguration.java | 4 +- blade-core-swagger/pom.xml | 2 +- .../swagger/SwaggerAutoConfiguration.java | 4 +- .../swagger/SwaggerHandlerConfiguration.java | 4 +- .../core/swagger/SwaggerProperties.java | 2 +- blade-core-test/pom.xml | 2 +- blade-core-tool/pom.xml | 2 +- .../tool/config/JacksonConfiguration.java | 4 +- .../tool/config/MessageConfiguration.java | 4 +- .../config/RedisTemplateConfiguration.java | 4 +- .../tool/config/RequestConfiguration.java | 4 +- .../core/tool/config/ToolConfiguration.java | 4 +- .../core/tool/utils/CacheUtil.java | 29 +++-- blade-core-transaction/pom.xml | 2 +- .../config/DataSourceConfiguration.java | 4 +- pom.xml | 19 +-- 63 files changed, 535 insertions(+), 134 deletions(-) create mode 100644 blade-core-loadbalancer/pom.xml create mode 100644 blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/config/BladeLoadBalancerConfiguration.java create mode 100644 blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/constant/LoadBalancerConstant.java create mode 100644 blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/props/BladeLoadBalancerProperties.java create mode 100644 blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/rule/GrayscaleEnvPostProcessor.java create mode 100644 blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/rule/GrayscaleLoadBalancer.java diff --git a/README.md b/README.md index 8ac81da..501384e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

Build Status Coverage Status - Downloads + Downloads

## SpringBlade微服务开发平台 @@ -25,19 +25,23 @@ blade-tool ├── blade-core-boot -- 业务包综合模块 ├── blade-core-cloud -- cloud封装模块 +├── blade-core-datascope -- 数据权限封装模块 ├── blade-core-develop -- 代码生成封装模块 ├── blade-core-launch -- 基础启动模块 +├── blade-core-loadbalancer -- 灰度服务封装模块 ├── blade-core-log -- 日志封装模块 ├── blade-core-mybatis -- mybatis拓展封装模块 ├── blade-core-oss -- 对象存储封装模块 -├── blade-core-secure -- 安全模块 +├── blade-core-report -- 报表封装模块 +├── blade-core-secure -- 安全封装模块 +├── blade-core-social -- 第三方登录封装模块 ├── blade-core-swagger -- swagger拓展封装模块 ├── blade-core-test -- 单元测试封装模块 ├── blade-core-tool -- 单元测试封装模块 └── blade-core-transaction -- 分布式事物封装模块 ``` -## 官网 +## 官方信息 * 官网地址:[https://bladex.vip](https://bladex.vip) * 问答社区:[https://sns.bladex.vip](https://sns.bladex.vip) * 会员计划:[SpringBlade会员计划](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade会员计划) @@ -46,23 +50,28 @@ blade-tool * 交流三群:`784729540`(满) * 交流四群:`1034621754`(满) * 交流五群:`946350912`(满) -* 交流六群: `511624269` +* 交流六群:`511624269`(满) +* 交流七群:`298061704` ## 在线演示 -* Sword演示地址:[https://sword.bladex.vip](https://sword.bladex.vip) -* Saber演示地址:[https://saber.bladex.vip](https://saber.bladex.vip) -* 数据大屏演示地址:[https://data.avuejs.com](https://data.avuejs.com) +* Saber-基于Vue:[https://saber.bladex.vip](https://saber.bladex.vip) +* Sword-基于React:[https://sword.bladex.vip](https://sword.bladex.vip) + +## 数据大屏 +* Caster-数据大屏展示系统:[https://caster.bladex.vip](https://caster.bladex.vip) + +## 技术文档 +* [SpringBlade开发手册一览](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade开发手册) +* [SpringBlade常见问题集锦](https://sns.bladex.vip/article-14966.html) +* [SpringBlade基于Kuboard部署K8S](https://kuboard.cn/learning/k8s-practice/spring-blade/) ## 项目地址 +* 核心框架项目地址:[https://gitee.com/smallc/blade-tool](https://gitee.com/smallc/blade-tool) * 后端Gitee地址:[https://gitee.com/smallc/SpringBlade](https://gitee.com/smallc/SpringBlade) * 后端Github地址:[https://github.com/chillzhuang/SpringBlade](https://github.com/chillzhuang/SpringBlade) * 后端SpringBoot版:[https://gitee.com/smallc/SpringBlade/tree/boot/](https://gitee.com/smallc/SpringBlade/tree/boot/) * 前端框架Sword(基于React):[https://gitee.com/smallc/Sword](https://gitee.com/smallc/Sword) * 前端框架Saber(基于Vue):[https://gitee.com/smallc/Saber](https://gitee.com/smallc/Saber) -* 核心框架项目地址:[https://github.com/chillzhuang/blade-tool](https://github.com/chillzhuang/blade-tool) - -## 技术文档 -* [SpringBlade开发手册](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade开发手册) ## 开源协议 LGPL([GNU Lesser General Public License](http://www.gnu.org/licenses/lgpl.html)) diff --git a/blade-core-boot/pom.xml b/blade-core-boot/pom.xml index 4f03760..35482fe 100644 --- a/blade-core-boot/pom.xml +++ b/blade-core-boot/pom.xml @@ -5,7 +5,7 @@ org.springblade blade-tool - 3.3.1 + 3.4.0 4.0.0 @@ -88,13 +88,13 @@ com.alibaba druid-spring-boot-starter - 1.1.22 + 1.2.11 mysql mysql-connector-java - 8.0.16 + 8.0.22 - + diff --git a/blade-core-boot/src/main/resources/log/logback_prod.xml b/blade-core-boot/src/main/resources/log/logback_prod.xml index fbeab21..334edd6 100644 --- a/blade-core-boot/src/main/resources/log/logback_prod.xml +++ b/blade-core-boot/src/main/resources/log/logback_prod.xml @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * --> - + diff --git a/blade-core-boot/src/main/resources/log/logback_test.xml b/blade-core-boot/src/main/resources/log/logback_test.xml index fbeab21..334edd6 100644 --- a/blade-core-boot/src/main/resources/log/logback_test.xml +++ b/blade-core-boot/src/main/resources/log/logback_test.xml @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * --> - + diff --git a/blade-core-cloud/pom.xml b/blade-core-cloud/pom.xml index 631c995..df03569 100644 --- a/blade-core-cloud/pom.xml +++ b/blade-core-cloud/pom.xml @@ -5,7 +5,7 @@ blade-tool org.springblade - 3.3.1 + 3.4.0 4.0.0 @@ -83,7 +83,7 @@ com.alibaba fastjson - 1.2.75 + 1.2.83_noneautotype diff --git a/blade-core-cloud/src/main/java/org/springblade/core/cloud/config/BladeCloudAutoConfiguration.java b/blade-core-cloud/src/main/java/org/springblade/core/cloud/config/BladeCloudAutoConfiguration.java index 415fa46..2bcf84d 100644 --- a/blade-core-cloud/src/main/java/org/springblade/core/cloud/config/BladeCloudAutoConfiguration.java +++ b/blade-core-cloud/src/main/java/org/springblade/core/cloud/config/BladeCloudAutoConfiguration.java @@ -22,11 +22,11 @@ import feign.RequestInterceptor; import org.springblade.core.cloud.feign.BladeFeignSentinel; import org.springblade.core.cloud.header.BladeFeignRequestHeaderInterceptor; import org.springblade.core.cloud.sentinel.BladeBlockExceptionHandler; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Scope; @@ -36,7 +36,7 @@ import org.springframework.context.annotation.Scope; * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @Import(BladeSentinelFilterConfiguration.class) @AutoConfigureBefore(SentinelFeignAutoConfiguration.class) public class BladeCloudAutoConfiguration { diff --git a/blade-core-cloud/src/main/java/org/springblade/core/cloud/http/HttpLoggingInterceptor.java b/blade-core-cloud/src/main/java/org/springblade/core/cloud/http/HttpLoggingInterceptor.java index 712c887..67eeb8a 100644 --- a/blade-core-cloud/src/main/java/org/springblade/core/cloud/http/HttpLoggingInterceptor.java +++ b/blade-core-cloud/src/main/java/org/springblade/core/cloud/http/HttpLoggingInterceptor.java @@ -104,6 +104,7 @@ public final class HttpLoggingInterceptor implements Interceptor { public interface Logger { /** * log + * * @param message message */ void log(String message); @@ -111,7 +112,7 @@ public final class HttpLoggingInterceptor implements Interceptor { /** * A {@link Logger} defaults output appropriate for the current platform. */ - Logger DEFAULT = message -> Platform.get().log(INFO, message, null); + Logger DEFAULT = message -> Platform.get().log(message, INFO, null); } public HttpLoggingInterceptor() { @@ -128,6 +129,7 @@ public final class HttpLoggingInterceptor implements Interceptor { /** * Change the level at which this interceptor logs. + * * @param level log Level * @return HttpLoggingInterceptor */ @@ -300,6 +302,7 @@ public final class HttpLoggingInterceptor implements Interceptor { * of code points to detect unicode control characters commonly used in binary file signatures. */ private static int plainCnt = 16; + private static boolean isPlaintext(Buffer buffer) { try { Buffer prefix = new Buffer(); diff --git a/blade-core-cloud/src/main/java/org/springblade/core/cloud/http/RestTemplateConfiguration.java b/blade-core-cloud/src/main/java/org/springblade/core/cloud/http/RestTemplateConfiguration.java index beaf20f..140343a 100644 --- a/blade-core-cloud/src/main/java/org/springblade/core/cloud/http/RestTemplateConfiguration.java +++ b/blade-core-cloud/src/main/java/org/springblade/core/cloud/http/RestTemplateConfiguration.java @@ -22,6 +22,7 @@ import org.springblade.core.cloud.header.BladeFeignAccountGetter; import org.springblade.core.cloud.props.BladeFeignHeadersProperties; import org.springblade.core.tool.utils.Charsets; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -30,7 +31,6 @@ import org.springframework.cloud.commons.httpclient.OkHttpClientConnectionPoolFa import org.springframework.cloud.commons.httpclient.OkHttpClientFactory; import org.springframework.cloud.openfeign.support.FeignHttpClientProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.http.client.OkHttp3ClientHttpRequestFactory; import org.springframework.http.converter.HttpMessageConverter; @@ -48,7 +48,7 @@ import java.util.concurrent.TimeUnit; * * @author L.cm */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AllArgsConstructor @ConditionalOnClass(okhttp3.OkHttpClient.class) @EnableConfigurationProperties(BladeFeignHeadersProperties.class) diff --git a/blade-core-cloud/src/main/java/org/springblade/core/cloud/version/VersionMappingAutoConfiguration.java b/blade-core-cloud/src/main/java/org/springblade/core/cloud/version/VersionMappingAutoConfiguration.java index 087caa3..962124f 100644 --- a/blade-core-cloud/src/main/java/org/springblade/core/cloud/version/VersionMappingAutoConfiguration.java +++ b/blade-core-cloud/src/main/java/org/springblade/core/cloud/version/VersionMappingAutoConfiguration.java @@ -15,10 +15,10 @@ */ package org.springblade.core.cloud.version; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * url版本号处理 @@ -27,7 +27,7 @@ import org.springframework.context.annotation.Configuration; * * @author L.cm */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnWebApplication public class VersionMappingAutoConfiguration { @Bean diff --git a/blade-core-datascope/pom.xml b/blade-core-datascope/pom.xml index ee094da..774e7eb 100644 --- a/blade-core-datascope/pom.xml +++ b/blade-core-datascope/pom.xml @@ -5,7 +5,7 @@ blade-tool org.springblade - 3.3.1 + 3.4.0 4.0.0 diff --git a/blade-core-datascope/src/main/java/org/springblade/core/datascope/config/DataScopeConfiguration.java b/blade-core-datascope/src/main/java/org/springblade/core/datascope/config/DataScopeConfiguration.java index f6a73ab..958ed06 100644 --- a/blade-core-datascope/src/main/java/org/springblade/core/datascope/config/DataScopeConfiguration.java +++ b/blade-core-datascope/src/main/java/org/springblade/core/datascope/config/DataScopeConfiguration.java @@ -22,11 +22,11 @@ import org.springblade.core.datascope.handler.DataScopeHandler; import org.springblade.core.datascope.handler.ScopeModelHandler; import org.springblade.core.datascope.interceptor.DataScopeInterceptor; import org.springblade.core.datascope.props.DataScopeProperties; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.core.JdbcTemplate; /** @@ -34,7 +34,7 @@ import org.springframework.jdbc.core.JdbcTemplate; * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AllArgsConstructor @EnableConfigurationProperties(DataScopeProperties.class) public class DataScopeConfiguration { diff --git a/blade-core-develop/pom.xml b/blade-core-develop/pom.xml index ed3ac06..3ce2235 100644 --- a/blade-core-develop/pom.xml +++ b/blade-core-develop/pom.xml @@ -5,7 +5,7 @@ blade-tool org.springblade - 3.3.1 + 3.4.0 4.0.0 diff --git a/blade-core-develop/src/main/java/org/springblade/develop/support/BladeCodeGenerator.java b/blade-core-develop/src/main/java/org/springblade/develop/support/BladeCodeGenerator.java index 1f960b8..b2163fa 100644 --- a/blade-core-develop/src/main/java/org/springblade/develop/support/BladeCodeGenerator.java +++ b/blade-core-develop/src/main/java/org/springblade/develop/support/BladeCodeGenerator.java @@ -20,12 +20,14 @@ import com.baomidou.mybatisplus.core.toolkit.StringPool; import com.baomidou.mybatisplus.generator.FastAutoGenerator; import com.baomidou.mybatisplus.generator.config.OutputFile; import com.baomidou.mybatisplus.generator.config.TemplateType; +import com.baomidou.mybatisplus.generator.config.builder.CustomFile; import com.baomidou.mybatisplus.generator.config.po.TableInfo; import com.baomidou.mybatisplus.generator.config.rules.DateType; import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; import com.baomidou.mybatisplus.generator.engine.VelocityTemplateEngine; import lombok.Data; import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.annotations.Mapper; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.StringUtil; import org.springblade.develop.constant.DevelopConstant; @@ -36,6 +38,7 @@ import org.springframework.core.io.support.PropertiesLoaderUtils; import java.io.File; import java.io.IOException; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Properties; @@ -91,6 +94,10 @@ public class BladeCodeGenerator { * 是否包含包装器 */ private Boolean hasWrapper = Boolean.TRUE; + /** + * 是否包含服务名 + */ + private Boolean hasServiceName = Boolean.FALSE; /** * 基础业务字段 */ @@ -159,10 +166,10 @@ public class BladeCodeGenerator { .globalConfig(builder -> builder.author(props.getProperty("author")).dateType(DateType.TIME_PACK).enableSwagger().outputDir(getOutputDir()).disableOpenDir()) .packageConfig(builder -> builder.parent(packageName).controller("controller").entity("entity").service("service").serviceImpl("service.impl").mapper("mapper").xml("mapper")) .strategyConfig(builder -> builder.addTablePrefix(tablePrefix).addInclude(includeTables).addExclude(excludeTables) - .entityBuilder().naming(NamingStrategy.underline_to_camel).columnNaming(NamingStrategy.underline_to_camel).enableLombok().superClass("org.springblade.core.mp.base.BaseEntity").addSuperEntityColumns(superEntityColumns) - .serviceBuilder().superServiceClass("org.springblade.core.mp.base.BaseService").superServiceImplClass("org.springblade.core.mp.base.BaseServiceImpl").formatServiceFileName("I%sService").formatServiceImplFileName("%sServiceImpl") - .mapperBuilder().enableMapperAnnotation().enableBaseResultMap().enableBaseColumnList().formatMapperFileName("%sMapper").formatXmlFileName("%sMapper") - .controllerBuilder().superClass("org.springblade.core.boot.ctrl.BladeController").formatFileName("%sController").enableRestStyle().enableHyphenStyle() + .entityBuilder().naming(NamingStrategy.underline_to_camel).columnNaming(NamingStrategy.underline_to_camel).enableLombok().superClass("org.springblade.core.mp.base.BaseEntity").addSuperEntityColumns(superEntityColumns).enableFileOverride() + .serviceBuilder().superServiceClass("org.springblade.core.mp.base.BaseService").superServiceImplClass("org.springblade.core.mp.base.BaseServiceImpl").formatServiceFileName("I%sService").formatServiceImplFileName("%sServiceImpl").enableFileOverride() + .mapperBuilder().mapperAnnotation(Mapper.class).enableBaseResultMap().enableBaseColumnList().formatMapperFileName("%sMapper").formatXmlFileName("%sMapper").enableFileOverride() + .controllerBuilder().superClass("org.springblade.core.boot.ctrl.BladeController").formatFileName("%sController").enableRestStyle().enableHyphenStyle().enableFileOverride() ) .templateConfig(builder -> builder.disable(TemplateType.ENTITY) .entity("/templates/entity.java.vm") @@ -177,14 +184,16 @@ public class BladeCodeGenerator { ) .templateEngine(new VelocityTemplateEngine() { @Override - protected void outputCustomFile(Map customFile, TableInfo tableInfo, Map objectMap) { + protected void outputCustomFile(List customFiles, TableInfo tableInfo, Map objectMap) { String entityName = tableInfo.getEntityName(); String entityNameLower = tableInfo.getEntityName().toLowerCase(); - customFile.forEach((key, value) -> { - String outputPath = getPathInfo(OutputFile.other); + customFiles.forEach(customFile -> { + String key = customFile.getFileName(); + String value = customFile.getTemplatePath(); + String outputPath = getPathInfo(OutputFile.parent); + objectMap.put("entityKey", entityNameLower); if (StringUtil.equals(key, "menu.sql")) { - objectMap.put("entityKey", entityNameLower); objectMap.put("menuId", IdWorker.getId()); objectMap.put("addMenuId", IdWorker.getId()); objectMap.put("editMenuId", IdWorker.getId()); diff --git a/blade-core-develop/src/main/resources/templates/controller.java.vm b/blade-core-develop/src/main/resources/templates/controller.java.vm index a869a87..625090a 100644 --- a/blade-core-develop/src/main/resources/templates/controller.java.vm +++ b/blade-core-develop/src/main/resources/templates/controller.java.vm @@ -53,7 +53,7 @@ import $!{superControllerClassPackage}; */ @RestController @AllArgsConstructor -@RequestMapping("#if($!{package.ModuleName})$!{package.ModuleName}#end/$!{entityKey}") +@RequestMapping("#if($!{hasServiceName})/$!{serviceName}#end/$!{entityKey}") @Api(value = "$!{table.comment}", tags = "$!{table.comment}接口") #if($!{superControllerClass}) public class $!{table.controllerName} extends $!{superControllerClass} { diff --git a/blade-core-launch/pom.xml b/blade-core-launch/pom.xml index fd61098..39f3fbf 100644 --- a/blade-core-launch/pom.xml +++ b/blade-core-launch/pom.xml @@ -5,7 +5,7 @@ blade-tool org.springblade - 3.3.1 + 3.4.0 4.0.0 diff --git a/blade-core-launch/src/main/java/org/springblade/core/launch/StartEventListener.java b/blade-core-launch/src/main/java/org/springblade/core/launch/StartEventListener.java index 34d31a8..5da789b 100644 --- a/blade-core-launch/src/main/java/org/springblade/core/launch/StartEventListener.java +++ b/blade-core-launch/src/main/java/org/springblade/core/launch/StartEventListener.java @@ -16,8 +16,8 @@ package org.springblade.core.launch; import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.web.context.WebServerInitializedEvent; -import org.springframework.context.annotation.Configuration; import org.springframework.context.event.EventListener; import org.springframework.core.annotation.Order; import org.springframework.core.env.Environment; @@ -30,7 +30,7 @@ import org.springframework.util.StringUtils; * @author Chill */ @Slf4j -@Configuration(proxyBeanMethods = false) +@AutoConfiguration public class StartEventListener { @Async diff --git a/blade-core-launch/src/main/java/org/springblade/core/launch/config/BladeLaunchConfiguration.java b/blade-core-launch/src/main/java/org/springblade/core/launch/config/BladeLaunchConfiguration.java index 9bbb5c2..ac007d0 100644 --- a/blade-core-launch/src/main/java/org/springblade/core/launch/config/BladeLaunchConfiguration.java +++ b/blade-core-launch/src/main/java/org/springblade/core/launch/config/BladeLaunchConfiguration.java @@ -17,8 +17,8 @@ package org.springblade.core.launch.config; import lombok.AllArgsConstructor; import org.springblade.core.launch.props.BladeProperties; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; @@ -27,7 +27,7 @@ import org.springframework.core.annotation.Order; * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AllArgsConstructor @Order(Ordered.HIGHEST_PRECEDENCE) @EnableConfigurationProperties({ diff --git a/blade-core-launch/src/main/java/org/springblade/core/launch/constant/AppConstant.java b/blade-core-launch/src/main/java/org/springblade/core/launch/constant/AppConstant.java index 5d00ef2..1ba6339 100644 --- a/blade-core-launch/src/main/java/org/springblade/core/launch/constant/AppConstant.java +++ b/blade-core-launch/src/main/java/org/springblade/core/launch/constant/AppConstant.java @@ -25,7 +25,7 @@ public interface AppConstant { /** * 应用版本 */ - String APPLICATION_VERSION = "3.3.1"; + String APPLICATION_VERSION = "3.4.0"; /** * 基础包 diff --git a/blade-core-launch/src/main/java/org/springblade/core/launch/server/ServerInfo.java b/blade-core-launch/src/main/java/org/springblade/core/launch/server/ServerInfo.java index 176db96..1fa02d9 100644 --- a/blade-core-launch/src/main/java/org/springblade/core/launch/server/ServerInfo.java +++ b/blade-core-launch/src/main/java/org/springblade/core/launch/server/ServerInfo.java @@ -19,8 +19,8 @@ import lombok.Getter; import org.springblade.core.launch.utils.INetUtil; import org.springframework.beans.factory.SmartInitializingSingleton; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.web.ServerProperties; -import org.springframework.context.annotation.Configuration; /** * 服务器信息 @@ -28,7 +28,7 @@ import org.springframework.context.annotation.Configuration; * @author Chill */ @Getter -@Configuration(proxyBeanMethods = false) +@AutoConfiguration public class ServerInfo implements SmartInitializingSingleton { private final ServerProperties serverProperties; private String hostName; diff --git a/blade-core-loadbalancer/pom.xml b/blade-core-loadbalancer/pom.xml new file mode 100644 index 0000000..5f3bae7 --- /dev/null +++ b/blade-core-loadbalancer/pom.xml @@ -0,0 +1,75 @@ + + + + blade-tool + org.springblade + 3.4.0 + + + 4.0.0 + + blade-core-loadbalancer + ${project.artifactId} + ${blade.tool.version} + jar + + + + + org.springframework.cloud + spring-cloud-starter-loadbalancer + + + + io.github.openfeign + feign-okhttp + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.nacos + nacos-client + + + ${alibaba.cloud.version} + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + com.alibaba.nacos + nacos-client + + + ${alibaba.cloud.version} + + + com.alibaba.nacos + nacos-client + ${alibaba.nacos.version} + + + + org.springframework + spring-web + provided + + + + org.springframework + spring-webflux + provided + + + + diff --git a/blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/config/BladeLoadBalancerConfiguration.java b/blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/config/BladeLoadBalancerConfiguration.java new file mode 100644 index 0000000..7f6c2b2 --- /dev/null +++ b/blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/config/BladeLoadBalancerConfiguration.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springblade.core.loadbalancer.config; + +import org.springblade.core.loadbalancer.props.BladeLoadBalancerProperties; +import org.springblade.core.loadbalancer.rule.GrayscaleLoadBalancer; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.AutoConfigureBefore; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.cloud.client.ServiceInstance; +import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClientConfiguration; +import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClientSpecification; +import org.springframework.cloud.loadbalancer.core.ReactorLoadBalancer; +import org.springframework.cloud.loadbalancer.core.ServiceInstanceListSupplier; +import org.springframework.cloud.loadbalancer.support.LoadBalancerClientFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.core.annotation.Order; +import org.springframework.core.env.Environment; + +/** + * blade 负载均衡策略 + * + * @author Chill + */ +@AutoConfiguration +@AutoConfigureBefore(LoadBalancerClientConfiguration.class) +@EnableConfigurationProperties(BladeLoadBalancerProperties.class) +@ConditionalOnProperty(value = BladeLoadBalancerProperties.PROPERTIES_PREFIX + ".enabled", matchIfMissing = true) +@Order(BladeLoadBalancerConfiguration.REACTIVE_SERVICE_INSTANCE_SUPPLIER_ORDER) +public class BladeLoadBalancerConfiguration { + public static final int REACTIVE_SERVICE_INSTANCE_SUPPLIER_ORDER = 193827465; + + @Bean + public ReactorLoadBalancer reactorServiceInstanceLoadBalancer(Environment environment, + LoadBalancerClientFactory loadBalancerClientFactory, + BladeLoadBalancerProperties bladeLoadBalancerProperties) { + String name = environment.getProperty(LoadBalancerClientFactory.PROPERTY_NAME); + return new GrayscaleLoadBalancer(loadBalancerClientFactory.getLazyProvider(name, ServiceInstanceListSupplier.class), bladeLoadBalancerProperties); + } + + @Bean + public LoadBalancerClientSpecification loadBalancerClientSpecification() { + return new LoadBalancerClientSpecification("default.bladeLoadBalancerConfiguration", + new Class[]{BladeLoadBalancerConfiguration.class}); + } + +} diff --git a/blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/constant/LoadBalancerConstant.java b/blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/constant/LoadBalancerConstant.java new file mode 100644 index 0000000..e53bd49 --- /dev/null +++ b/blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/constant/LoadBalancerConstant.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springblade.core.loadbalancer.constant; + +/** + * LoadBalancer 常量 + * + * @author Chill + */ +public interface LoadBalancerConstant { + + /** + * 灰度服务的请求头参数 + */ + String VERSION_NAME = "version"; + +} diff --git a/blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/props/BladeLoadBalancerProperties.java b/blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/props/BladeLoadBalancerProperties.java new file mode 100644 index 0000000..d32a45c --- /dev/null +++ b/blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/props/BladeLoadBalancerProperties.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springblade.core.loadbalancer.props; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.cloud.context.config.annotation.RefreshScope; + +import java.util.ArrayList; +import java.util.List; + +/** + * LoadBalancer 配置 + * + * @author Chill + */ +@Getter +@Setter +@RefreshScope +@ConfigurationProperties(BladeLoadBalancerProperties.PROPERTIES_PREFIX) +public class BladeLoadBalancerProperties { + public static final String PROPERTIES_PREFIX = "blade.loadbalancer"; + + /** + * 是否开启自定义负载均衡 + */ + private boolean enabled = true; + /** + * 灰度服务版本 + */ + private String version; + /** + * 优先的ip列表,支持通配符,例如:10.20.0.8*、10.20.0.* + */ + private List priorIpPattern = new ArrayList<>(); + +} diff --git a/blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/rule/GrayscaleEnvPostProcessor.java b/blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/rule/GrayscaleEnvPostProcessor.java new file mode 100644 index 0000000..50218aa --- /dev/null +++ b/blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/rule/GrayscaleEnvPostProcessor.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springblade.core.loadbalancer.rule; + +import net.dreamlu.mica.auto.annotation.AutoEnvPostProcessor; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.env.EnvironmentPostProcessor; +import org.springframework.core.Ordered; +import org.springframework.core.env.ConfigurableEnvironment; +import org.springframework.util.StringUtils; + +/** + * 灰度版本 自动处理 + * + * @author Chill + */ +@AutoEnvPostProcessor +public class GrayscaleEnvPostProcessor implements EnvironmentPostProcessor, Ordered { + private static final String GREYSCALE_KEY = "blade.loadbalancer.version"; + private static final String METADATA_KEY = "spring.cloud.nacos.discovery.metadata.version"; + + @Override + public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { + String version = environment.getProperty(GREYSCALE_KEY); + + if (StringUtils.hasText(version)) { + environment.getSystemProperties().put(METADATA_KEY, version); + } + } + + @Override + public int getOrder() { + return Ordered.LOWEST_PRECEDENCE; + } + +} diff --git a/blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/rule/GrayscaleLoadBalancer.java b/blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/rule/GrayscaleLoadBalancer.java new file mode 100644 index 0000000..c946444 --- /dev/null +++ b/blade-core-loadbalancer/src/main/java/org/springblade/core/loadbalancer/rule/GrayscaleLoadBalancer.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springblade.core.loadbalancer.rule; + +import com.alibaba.nacos.common.utils.StringUtils; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.loadbalancer.props.BladeLoadBalancerProperties; +import org.springframework.beans.factory.ObjectProvider; +import org.springframework.cloud.client.ServiceInstance; +import org.springframework.cloud.client.loadbalancer.*; +import org.springframework.cloud.loadbalancer.core.NoopServiceInstanceListSupplier; +import org.springframework.cloud.loadbalancer.core.ReactorServiceInstanceLoadBalancer; +import org.springframework.cloud.loadbalancer.core.ServiceInstanceListSupplier; +import org.springframework.http.HttpHeaders; +import org.springframework.util.CollectionUtils; +import org.springframework.util.PatternMatchUtils; +import reactor.core.publisher.Mono; + +import java.util.List; +import java.util.concurrent.ThreadLocalRandom; +import java.util.stream.Collectors; + +import static org.springblade.core.loadbalancer.constant.LoadBalancerConstant.VERSION_NAME; + +/** + * LoadBalancer 负载规则 + * + * @author Chill + */ +@Slf4j +@RequiredArgsConstructor +public class GrayscaleLoadBalancer implements ReactorServiceInstanceLoadBalancer { + private final ObjectProvider serviceInstanceListSupplierProvider; + private final BladeLoadBalancerProperties bladeLoadBalancerProperties; + + @Override + public Mono> choose(Request request) { + ServiceInstanceListSupplier supplier = serviceInstanceListSupplierProvider + .getIfAvailable(NoopServiceInstanceListSupplier::new); + return supplier.get(request).next() + .map(serviceInstances -> getInstanceResponse(serviceInstances, request)); + } + + /** + * 自定义节点规则返回目标节点 + */ + private Response getInstanceResponse(List instances, Request request) { + // 注册中心无可用实例 返回空 + if (CollectionUtils.isEmpty(instances)) { + return new EmptyResponse(); + } + // 指定ip则返回满足ip的服务 + List priorIpPattern = bladeLoadBalancerProperties.getPriorIpPattern(); + if (!priorIpPattern.isEmpty()) { + String[] priorIpPatterns = priorIpPattern.toArray(new String[0]); + List priorIpInstances = instances.stream().filter( + (i -> PatternMatchUtils.simpleMatch(priorIpPatterns, i.getHost())) + ).collect(Collectors.toList()); + if (!priorIpInstances.isEmpty()) { + instances = priorIpInstances; + } + } + + // 获取灰度版本号 + DefaultRequestContext context = (DefaultRequestContext) request.getContext(); + RequestData requestData = (RequestData) context.getClientRequest(); + HttpHeaders headers = requestData.getHeaders(); + String versionName = headers.getFirst(VERSION_NAME); + + // 没有指定灰度版本则返回正式的服务 + if (StringUtils.isBlank(versionName)) { + List noneGrayscaleInstances = instances.stream().filter( + i -> !i.getMetadata().containsKey(VERSION_NAME) + ).collect(Collectors.toList()); + return randomInstance(noneGrayscaleInstances); + } + + // 指定灰度版本则返回标记的服务 + List grayscaleInstances = instances.stream().filter(i -> { + String versionNameInMetadata = i.getMetadata().get(VERSION_NAME); + return StringUtils.equalsIgnoreCase(versionNameInMetadata, versionName); + }).collect(Collectors.toList()); + return randomInstance(grayscaleInstances); + } + + /** + * 采用随机规则返回 + */ + private Response randomInstance(List instances) { + // 若没有可用节点则返回空 + if (instances.isEmpty()) { + return new EmptyResponse(); + } + + // 挑选随机节点返回 + int randomIndex = ThreadLocalRandom.current().nextInt(instances.size()); + ServiceInstance instance = instances.get(randomIndex % instances.size()); + return new DefaultResponse(instance); + } +} diff --git a/blade-core-log/pom.xml b/blade-core-log/pom.xml index 87b77cc..17e42a7 100644 --- a/blade-core-log/pom.xml +++ b/blade-core-log/pom.xml @@ -5,7 +5,7 @@ blade-tool org.springblade - 3.3.1 + 3.4.0 4.0.0 diff --git a/blade-core-log/src/main/java/org/springblade/core/log/config/BladeErrorMvcAutoConfiguration.java b/blade-core-log/src/main/java/org/springblade/core/log/config/BladeErrorMvcAutoConfiguration.java index 5221f11..7490d61 100644 --- a/blade-core-log/src/main/java/org/springblade/core/log/config/BladeErrorMvcAutoConfiguration.java +++ b/blade-core-log/src/main/java/org/springblade/core/log/config/BladeErrorMvcAutoConfiguration.java @@ -19,6 +19,7 @@ package org.springblade.core.log.config; import lombok.AllArgsConstructor; import org.springblade.core.log.error.BladeErrorAttributes; import org.springblade.core.log.error.BladeErrorController; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -31,7 +32,6 @@ import org.springframework.boot.web.servlet.error.DefaultErrorAttributes; import org.springframework.boot.web.servlet.error.ErrorAttributes; import org.springframework.boot.web.servlet.error.ErrorController; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.DispatcherServlet; import javax.servlet.Servlet; @@ -41,7 +41,7 @@ import javax.servlet.Servlet; * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AllArgsConstructor @ConditionalOnWebApplication @AutoConfigureBefore(ErrorMvcAutoConfiguration.class) diff --git a/blade-core-log/src/main/java/org/springblade/core/log/config/BladeLogToolAutoConfiguration.java b/blade-core-log/src/main/java/org/springblade/core/log/config/BladeLogToolAutoConfiguration.java index 062a655..1627f6b 100644 --- a/blade-core-log/src/main/java/org/springblade/core/log/config/BladeLogToolAutoConfiguration.java +++ b/blade-core-log/src/main/java/org/springblade/core/log/config/BladeLogToolAutoConfiguration.java @@ -17,24 +17,24 @@ package org.springblade.core.log.config; import lombok.AllArgsConstructor; -import org.springblade.core.log.aspect.ApiLogAspect; -import org.springblade.core.log.event.ApiLogListener; -import org.springblade.core.log.event.UsualLogListener; -import org.springblade.core.log.event.ErrorLogListener; -import org.springblade.core.log.logger.BladeLogger; import org.springblade.core.launch.props.BladeProperties; import org.springblade.core.launch.server.ServerInfo; +import org.springblade.core.log.aspect.ApiLogAspect; +import org.springblade.core.log.event.ApiLogListener; +import org.springblade.core.log.event.ErrorLogListener; +import org.springblade.core.log.event.UsualLogListener; import org.springblade.core.log.feign.ILogClient; +import org.springblade.core.log.logger.BladeLogger; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * 日志工具自动配置 * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AllArgsConstructor @ConditionalOnWebApplication public class BladeLogToolAutoConfiguration { diff --git a/blade-core-log/src/main/java/org/springblade/core/log/error/BladeRestExceptionTranslator.java b/blade-core-log/src/main/java/org/springblade/core/log/error/BladeRestExceptionTranslator.java index cdee69e..881b881 100644 --- a/blade-core-log/src/main/java/org/springblade/core/log/error/BladeRestExceptionTranslator.java +++ b/blade-core-log/src/main/java/org/springblade/core/log/error/BladeRestExceptionTranslator.java @@ -25,9 +25,9 @@ import org.springblade.core.tool.api.ResultCode; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.UrlUtil; import org.springblade.core.tool.utils.WebUtil; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; import org.springframework.http.converter.HttpMessageNotReadableException; import org.springframework.validation.BindException; @@ -55,7 +55,7 @@ import java.util.Set; * @author Chill */ @Slf4j -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass({Servlet.class, DispatcherServlet.class}) @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) @RestControllerAdvice diff --git a/blade-core-mybatis/pom.xml b/blade-core-mybatis/pom.xml index f708f9f..b792d16 100644 --- a/blade-core-mybatis/pom.xml +++ b/blade-core-mybatis/pom.xml @@ -5,7 +5,7 @@ blade-tool org.springblade - 3.3.1 + 3.4.0 4.0.0 diff --git a/blade-core-mybatis/src/main/java/org/springblade/core/mp/config/MybatisPlusConfiguration.java b/blade-core-mybatis/src/main/java/org/springblade/core/mp/config/MybatisPlusConfiguration.java index 645216d..22ae208 100644 --- a/blade-core-mybatis/src/main/java/org/springblade/core/mp/config/MybatisPlusConfiguration.java +++ b/blade-core-mybatis/src/main/java/org/springblade/core/mp/config/MybatisPlusConfiguration.java @@ -31,11 +31,11 @@ import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.ObjectUtil; import org.springframework.beans.factory.ObjectProvider; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.AnnotationAwareOrderComparator; /** @@ -43,7 +43,7 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator; * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AllArgsConstructor @MapperScan("org.springblade.**.mapper.**") @EnableConfigurationProperties(MybatisPlusProperties.class) diff --git a/blade-core-oss/pom.xml b/blade-core-oss/pom.xml index 1fde727..0fa60c1 100644 --- a/blade-core-oss/pom.xml +++ b/blade-core-oss/pom.xml @@ -5,7 +5,7 @@ blade-tool org.springblade - 3.3.1 + 3.4.0 4.0.0 diff --git a/blade-core-oss/src/main/java/org/springblade/core/oss/config/AliossConfiguration.java b/blade-core-oss/src/main/java/org/springblade/core/oss/config/AliossConfiguration.java index cc9f8d6..661d94e 100644 --- a/blade-core-oss/src/main/java/org/springblade/core/oss/config/AliossConfiguration.java +++ b/blade-core-oss/src/main/java/org/springblade/core/oss/config/AliossConfiguration.java @@ -24,20 +24,20 @@ import org.springblade.core.oss.AliossTemplate; import org.springblade.core.oss.props.OssProperties; import org.springblade.core.oss.rule.BladeOssRule; import org.springblade.core.oss.rule.OssRule; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * Alioss配置类 * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AllArgsConstructor @AutoConfigureAfter(QiniuConfiguration.class) @EnableConfigurationProperties(OssProperties.class) diff --git a/blade-core-oss/src/main/java/org/springblade/core/oss/config/QiniuConfiguration.java b/blade-core-oss/src/main/java/org/springblade/core/oss/config/QiniuConfiguration.java index 8bd1b5d..0d64a9c 100644 --- a/blade-core-oss/src/main/java/org/springblade/core/oss/config/QiniuConfiguration.java +++ b/blade-core-oss/src/main/java/org/springblade/core/oss/config/QiniuConfiguration.java @@ -24,19 +24,19 @@ import org.springblade.core.oss.QiniuTemplate; import org.springblade.core.oss.props.OssProperties; import org.springblade.core.oss.rule.BladeOssRule; import org.springblade.core.oss.rule.OssRule; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * Oss配置类 * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AllArgsConstructor @EnableConfigurationProperties(OssProperties.class) @ConditionalOnProperty(value = "oss.name", havingValue = "qiniu") diff --git a/blade-core-report/pom.xml b/blade-core-report/pom.xml index 381c632..a54e55c 100644 --- a/blade-core-report/pom.xml +++ b/blade-core-report/pom.xml @@ -5,7 +5,7 @@ blade-tool org.springblade - 3.3.1 + 3.4.0 4.0.0 diff --git a/blade-core-report/src/main/java/org/springblade/core/report/config/ReportConfiguration.java b/blade-core-report/src/main/java/org/springblade/core/report/config/ReportConfiguration.java index 18f5d68..a2c7c03 100644 --- a/blade-core-report/src/main/java/org/springblade/core/report/config/ReportConfiguration.java +++ b/blade-core-report/src/main/java/org/springblade/core/report/config/ReportConfiguration.java @@ -23,12 +23,12 @@ import org.springblade.core.report.props.ReportProperties; import org.springblade.core.report.provider.DatabaseProvider; import org.springblade.core.report.provider.ReportPlaceholderProvider; import org.springblade.core.report.service.IReportFileService; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; import org.springframework.core.annotation.Order; @@ -40,7 +40,7 @@ import javax.servlet.Servlet; * @author Chill */ @Order -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnProperty(value = "report.enabled", havingValue = "true", matchIfMissing = true) @EnableConfigurationProperties({ReportProperties.class, ReportDatabaseProperties.class}) @ImportResource("classpath:ureport-console-context.xml") diff --git a/blade-core-secure/pom.xml b/blade-core-secure/pom.xml index cd1d68c..eabf8b8 100644 --- a/blade-core-secure/pom.xml +++ b/blade-core-secure/pom.xml @@ -5,7 +5,7 @@ blade-tool org.springblade - 3.3.1 + 3.4.0 4.0.0 diff --git a/blade-core-secure/src/main/java/org/springblade/core/secure/config/RegistryConfiguration.java b/blade-core-secure/src/main/java/org/springblade/core/secure/config/RegistryConfiguration.java index d3b5a23..bdfc18c 100644 --- a/blade-core-secure/src/main/java/org/springblade/core/secure/config/RegistryConfiguration.java +++ b/blade-core-secure/src/main/java/org/springblade/core/secure/config/RegistryConfiguration.java @@ -17,10 +17,10 @@ package org.springblade.core.secure.config; import org.springblade.core.secure.registry.SecureRegistry; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; /** @@ -29,7 +29,7 @@ import org.springframework.core.annotation.Order; * @author Chill */ @Order -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AutoConfigureBefore(SecureConfiguration.class) public class RegistryConfiguration { diff --git a/blade-core-secure/src/main/java/org/springblade/core/secure/config/SecureConfiguration.java b/blade-core-secure/src/main/java/org/springblade/core/secure/config/SecureConfiguration.java index 5334ccf..2e06e06 100644 --- a/blade-core-secure/src/main/java/org/springblade/core/secure/config/SecureConfiguration.java +++ b/blade-core-secure/src/main/java/org/springblade/core/secure/config/SecureConfiguration.java @@ -24,10 +24,10 @@ import org.springblade.core.secure.props.BladeSecureProperties; import org.springblade.core.secure.provider.ClientDetailsServiceImpl; import org.springblade.core.secure.provider.IClientDetailsService; import org.springblade.core.secure.registry.SecureRegistry; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; @@ -39,7 +39,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; * @author Chill */ @Order -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AllArgsConstructor @EnableConfigurationProperties({BladeSecureProperties.class}) public class SecureConfiguration implements WebMvcConfigurer { diff --git a/blade-core-social/pom.xml b/blade-core-social/pom.xml index 137c624..bc9640c 100644 --- a/blade-core-social/pom.xml +++ b/blade-core-social/pom.xml @@ -5,7 +5,7 @@ blade-tool org.springblade - 3.3.1 + 3.4.0 4.0.0 diff --git a/blade-core-social/src/main/java/org/springblade/core/social/config/SocialConfiguration.java b/blade-core-social/src/main/java/org/springblade/core/social/config/SocialConfiguration.java index b6d93b6..0a06a8a 100644 --- a/blade-core-social/src/main/java/org/springblade/core/social/config/SocialConfiguration.java +++ b/blade-core-social/src/main/java/org/springblade/core/social/config/SocialConfiguration.java @@ -19,17 +19,17 @@ import com.xkcoding.http.HttpUtil; import com.xkcoding.http.support.Http; import com.xkcoding.http.support.httpclient.HttpClientImpl; import org.springblade.core.social.props.SocialProperties; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * SocialConfiguration * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @EnableConfigurationProperties(SocialProperties.class) public class SocialConfiguration { diff --git a/blade-core-swagger/pom.xml b/blade-core-swagger/pom.xml index 7028ed4..34efeb6 100644 --- a/blade-core-swagger/pom.xml +++ b/blade-core-swagger/pom.xml @@ -5,7 +5,7 @@ blade-tool org.springblade - 3.3.1 + 3.4.0 4.0.0 diff --git a/blade-core-swagger/src/main/java/org/springblade/core/swagger/SwaggerAutoConfiguration.java b/blade-core-swagger/src/main/java/org/springblade/core/swagger/SwaggerAutoConfiguration.java index 31f2123..0d8c13c 100644 --- a/blade-core-swagger/src/main/java/org/springblade/core/swagger/SwaggerAutoConfiguration.java +++ b/blade-core-swagger/src/main/java/org/springblade/core/swagger/SwaggerAutoConfiguration.java @@ -20,10 +20,10 @@ import com.github.xiaoymin.knife4j.spring.extension.OpenApiExtensionResolver; import com.google.common.collect.Lists; import lombok.AllArgsConstructor; import org.springblade.core.launch.props.BladeProperties; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration; import springfox.documentation.builders.ApiInfoBuilder; @@ -44,7 +44,7 @@ import java.util.List; * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @EnableSwagger @EnableConfigurationProperties(SwaggerProperties.class) @Import(BeanValidatorPluginsConfiguration.class) diff --git a/blade-core-swagger/src/main/java/org/springblade/core/swagger/SwaggerHandlerConfiguration.java b/blade-core-swagger/src/main/java/org/springblade/core/swagger/SwaggerHandlerConfiguration.java index c08c6e5..0cc081b 100644 --- a/blade-core-swagger/src/main/java/org/springblade/core/swagger/SwaggerHandlerConfiguration.java +++ b/blade-core-swagger/src/main/java/org/springblade/core/swagger/SwaggerHandlerConfiguration.java @@ -17,8 +17,8 @@ package org.springblade.core.swagger; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanPostProcessor; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.util.ReflectionUtils; import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping; import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider; @@ -32,7 +32,7 @@ import java.util.stream.Collectors; * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration public class SwaggerHandlerConfiguration { @Bean diff --git a/blade-core-swagger/src/main/java/org/springblade/core/swagger/SwaggerProperties.java b/blade-core-swagger/src/main/java/org/springblade/core/swagger/SwaggerProperties.java index 2645d46..07c9a3c 100644 --- a/blade-core-swagger/src/main/java/org/springblade/core/swagger/SwaggerProperties.java +++ b/blade-core-swagger/src/main/java/org/springblade/core/swagger/SwaggerProperties.java @@ -55,7 +55,7 @@ public class SwaggerProperties { /** * 版本 **/ - private String version = "3.3.1"; + private String version = "3.4.0"; /** * 许可证 **/ diff --git a/blade-core-test/pom.xml b/blade-core-test/pom.xml index dcb5d7b..09f950f 100644 --- a/blade-core-test/pom.xml +++ b/blade-core-test/pom.xml @@ -5,7 +5,7 @@ org.springblade blade-tool - 3.3.1 + 3.4.0 4.0.0 diff --git a/blade-core-tool/pom.xml b/blade-core-tool/pom.xml index 0ae04c4..dadc4f9 100644 --- a/blade-core-tool/pom.xml +++ b/blade-core-tool/pom.xml @@ -6,7 +6,7 @@ org.springblade blade-tool - 3.3.1 + 3.4.0 4.0.0 diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/config/JacksonConfiguration.java b/blade-core-tool/src/main/java/org/springblade/core/tool/config/JacksonConfiguration.java index a5b0058..50386ae 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/config/JacksonConfiguration.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/config/JacksonConfiguration.java @@ -23,11 +23,11 @@ import com.fasterxml.jackson.databind.SerializationFeature; import lombok.AllArgsConstructor; import org.springblade.core.tool.jackson.BladeJavaTimeModule; import org.springblade.core.tool.utils.DateUtil; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; @@ -41,7 +41,7 @@ import java.util.TimeZone; * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AllArgsConstructor @ConditionalOnClass(ObjectMapper.class) @AutoConfigureBefore(JacksonAutoConfiguration.class) diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/config/MessageConfiguration.java b/blade-core-tool/src/main/java/org/springblade/core/tool/config/MessageConfiguration.java index 51fb28c..1997103 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/config/MessageConfiguration.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/config/MessageConfiguration.java @@ -20,7 +20,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import lombok.AllArgsConstructor; import org.springblade.core.tool.jackson.MappingApiJackson2HttpMessageConverter; import org.springblade.core.tool.utils.Charsets; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import org.springframework.http.converter.*; @@ -34,7 +34,7 @@ import java.util.List; * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AllArgsConstructor @Order(Ordered.HIGHEST_PRECEDENCE) public class MessageConfiguration implements WebMvcConfigurer { diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/config/RedisTemplateConfiguration.java b/blade-core-tool/src/main/java/org/springblade/core/tool/config/RedisTemplateConfiguration.java index 5f0ee66..380ab08 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/config/RedisTemplateConfiguration.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/config/RedisTemplateConfiguration.java @@ -17,6 +17,7 @@ package org.springblade.core.tool.config; import org.springblade.core.tool.redis.RedisKeySerializer; import org.springblade.core.tool.utils.RedisUtil; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -24,7 +25,6 @@ import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.cache.RedisCacheConfiguration; import org.springframework.data.redis.cache.RedisCacheManager; import org.springframework.data.redis.cache.RedisCacheWriter; @@ -41,7 +41,7 @@ import java.time.Duration; * @author Chill */ @EnableCaching -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AutoConfigureBefore(RedisAutoConfiguration.class) public class RedisTemplateConfiguration { diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/config/RequestConfiguration.java b/blade-core-tool/src/main/java/org/springblade/core/tool/config/RequestConfiguration.java index 2dd4f6d..1289bf9 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/config/RequestConfiguration.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/config/RequestConfiguration.java @@ -19,10 +19,10 @@ import lombok.AllArgsConstructor; import org.springblade.core.tool.request.BladeRequestFilter; import org.springblade.core.tool.request.RequestProperties; import org.springblade.core.tool.request.XssProperties; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; import javax.servlet.DispatcherType; @@ -32,7 +32,7 @@ import javax.servlet.DispatcherType; * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @AllArgsConstructor @EnableConfigurationProperties({RequestProperties.class, XssProperties.class}) public class RequestConfiguration { diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/config/ToolConfiguration.java b/blade-core-tool/src/main/java/org/springblade/core/tool/config/ToolConfiguration.java index 9dfc257..a9adc0e 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/config/ToolConfiguration.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/config/ToolConfiguration.java @@ -17,8 +17,8 @@ package org.springblade.core.tool.config; import org.springblade.core.tool.utils.SpringUtil; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @@ -28,7 +28,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @Order(Ordered.HIGHEST_PRECEDENCE) public class ToolConfiguration implements WebMvcConfigurer { diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/CacheUtil.java b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/CacheUtil.java index 8d01329..0dfcb7d 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/CacheUtil.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/CacheUtil.java @@ -1,18 +1,17 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.springblade.core.tool.utils; diff --git a/blade-core-transaction/pom.xml b/blade-core-transaction/pom.xml index 727b28a..acf9543 100644 --- a/blade-core-transaction/pom.xml +++ b/blade-core-transaction/pom.xml @@ -5,7 +5,7 @@ blade-tool org.springblade - 3.3.1 + 3.4.0 4.0.0 diff --git a/blade-core-transaction/src/main/java/org/springblade/core/transaction/config/DataSourceConfiguration.java b/blade-core-transaction/src/main/java/org/springblade/core/transaction/config/DataSourceConfiguration.java index a6cfb48..e5c875e 100644 --- a/blade-core-transaction/src/main/java/org/springblade/core/transaction/config/DataSourceConfiguration.java +++ b/blade-core-transaction/src/main/java/org/springblade/core/transaction/config/DataSourceConfiguration.java @@ -15,14 +15,14 @@ */ package org.springblade.core.transaction.config; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.AutoConfiguration; /** * 分布式事务数据源配置 * * @author Chill */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration public class DataSourceConfiguration { } diff --git a/pom.xml b/pom.xml index d987360..88eac72 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springblade blade-tool - 3.3.1 + 3.4.0 pom blade-tool @@ -36,27 +36,27 @@ - 3.3.1 + 3.4.0 1.8 3.8.1 2.10.5 1.6.2 2.0.9 - 3.5.1 - 3.5.2 + 3.5.2 + 3.5.3 1.6.0 3.4.2 20.0 - 2.6.2 + 2.7.1 1.2.5 2021.0.1.0 - 2.0.4 - 1.4.2 + 2.1.0 + 1.5.1.1 2.0.0.RELEASE - 2.6.6 - 2021.0.1 + 2.7.1 + 2021.0.3 Cairo-SR8 UTF-8 @@ -68,6 +68,7 @@ blade-core-cloud blade-core-develop blade-core-launch + blade-core-loadbalancer blade-core-log blade-core-mybatis blade-core-secure