diff --git a/.springjavaformatconfig b/.springjavaformatconfig new file mode 100644 index 0000000..1264378 --- /dev/null +++ b/.springjavaformatconfig @@ -0,0 +1 @@ +java-baseline=8 \ No newline at end of file diff --git a/README.md b/README.md index 0d9da6b..60a48c5 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ #### 介绍 内核框架 #### 依赖 -- spring-boot 2.5.10 -- spring-cloud 2020.0.4 -- spring-cloud-alibaba 2021.1 +- spring-boot 2.6.4 +- spring-cloud 2021.0.1 +- spring-cloud-alibaba 2021.0.1.0 - kernel-dependencies 1.6.3 #### 代码 采用阿里巴巴代码规范,使用`spring-javaformat`格式化代码 diff --git a/kernel-all-spring-boot-starter/pom.xml b/kernel-all-spring-boot-starter/pom.xml index f185656..a5f5af5 100644 --- a/kernel-all-spring-boot-starter/pom.xml +++ b/kernel-all-spring-boot-starter/pom.xml @@ -20,12 +20,12 @@ com.gitee.fubluesky.kernel kernel - 1.6.6 + 1.6.7 4.0.0 kernel-all-spring-boot-starter - 1.6.6 + 1.6.7 spring-boot 依赖引用 2021-Now pom diff --git a/kernel-auth/auth-api/pom.xml b/kernel-auth/auth-api/pom.xml index 06a16f6..3d5f39c 100644 --- a/kernel-auth/auth-api/pom.xml +++ b/kernel-auth/auth-api/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-auth - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-auth/auth-sdk/pom.xml b/kernel-auth/auth-sdk/pom.xml index 75f6559..8b49cf9 100644 --- a/kernel-auth/auth-sdk/pom.xml +++ b/kernel-auth/auth-sdk/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-auth - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-auth/auth-spring-boot-starter/pom.xml b/kernel-auth/auth-spring-boot-starter/pom.xml index 09e1b13..85490e6 100644 --- a/kernel-auth/auth-spring-boot-starter/pom.xml +++ b/kernel-auth/auth-spring-boot-starter/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-auth - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-auth/auth-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/auth/autoconfigure/AuthAutoConfiguration.java b/kernel-auth/auth-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/auth/autoconfigure/AuthAutoConfiguration.java index 2dce352..5da429b 100644 --- a/kernel-auth/auth-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/auth/autoconfigure/AuthAutoConfiguration.java +++ b/kernel-auth/auth-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/auth/autoconfigure/AuthAutoConfiguration.java @@ -30,7 +30,6 @@ import com.gitee.fubluesky.kernel.security.api.CaptchaApi; import com.gitee.fubluesky.kernel.security.api.pojo.CaptchaProperties; import com.gitee.fubluesky.kernel.security.autoconfigure.CaptchaAutoConfiguration; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; @@ -45,39 +44,17 @@ @AutoConfigureAfter(value = { JwtAutoConfiguration.class, CaptchaAutoConfiguration.class }) public class AuthAutoConfiguration { - @Autowired - private AuthProperties authProperties; - - @Autowired - private LoginApi loginApi; - @Bean @ConditionalOnMissingBean(PasswordEncryptApi.class) public PasswordEncryptApi passwordEncryptApi() { return new BcryptPasswordEncrypt(); } - @Autowired - private PasswordEncryptApi passwordEncryptApi; - - @Autowired - private CacheOperatorApi loginUserTokenCache; - - @Autowired - private CacheOperatorApi loginUserCache; - - @Autowired - private CaptchaApi captchaApi; - - @Autowired - private CaptchaProperties captchaProperties; - - @Autowired - private JwtApi jwtApi; - @Bean @ConditionalOnMissingBean(AuthApi.class) - public AuthApi authApi() { + public AuthApi authApi(AuthProperties authProperties, LoginApi loginApi, PasswordEncryptApi passwordEncryptApi, + CacheOperatorApi loginUserTokenCache, CacheOperatorApi loginUserCache, + CaptchaApi captchaApi, CaptchaProperties captchaProperties, JwtApi jwtApi) { return new AuthImpl(authProperties, loginApi, passwordEncryptApi, loginUserTokenCache, loginUserCache, captchaApi, captchaProperties, jwtApi); } diff --git a/kernel-auth/auth-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/auth/autoconfigure/LoginAutoConfiguration.java b/kernel-auth/auth-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/auth/autoconfigure/LoginAutoConfiguration.java index 9ac3e64..9fc299f 100644 --- a/kernel-auth/auth-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/auth/autoconfigure/LoginAutoConfiguration.java +++ b/kernel-auth/auth-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/auth/autoconfigure/LoginAutoConfiguration.java @@ -25,7 +25,6 @@ import com.gitee.fubluesky.kernel.auth.cache.LoginUserTokenRedisCache; import com.gitee.fubluesky.kernel.cache.api.CacheOperatorApi; import com.gitee.fubluesky.kernel.cache.redis.utils.RedisCacheUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -50,35 +49,26 @@ public AuthProperties authProperties() { return new AuthProperties(); } - @Autowired - private AuthProperties authProperties; - @Bean public RedisTemplate loginUserRedisTemplate(RedisConnectionFactory redisConnectionFactory) { return RedisCacheUtils.getObjectRedisTemplate(redisConnectionFactory); } - @Autowired - private RedisTemplate loginUserRedisTemplate; - @Bean @ConditionalOnMissingBean(name = "loginUserTokenCache") - public CacheOperatorApi loginUserTokenCache() { + public CacheOperatorApi loginUserTokenCache(RedisTemplate loginUserRedisTemplate) { return new LoginUserTokenRedisCache(loginUserRedisTemplate); } @Bean @ConditionalOnMissingBean(name = "loginUserCache") - public CacheOperatorApi loginUserCache() { + public CacheOperatorApi loginUserCache(RedisTemplate loginUserRedisTemplate) { return new LoginUserRedisCache(loginUserRedisTemplate); } - @Autowired - private CacheOperatorApi loginUserCache; - @Bean @ConditionalOnMissingBean(LoginApi.class) - public LoginApi loginApi() { + public LoginApi loginApi(AuthProperties authProperties, CacheOperatorApi loginUserCache) { return new LoginImpl(authProperties, loginUserCache); } diff --git a/kernel-auth/auth-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/auth/autoconfigure/SecurityAutoConfiguration.java b/kernel-auth/auth-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/auth/autoconfigure/SecurityAutoConfiguration.java index 8d599b6..7a04fce 100644 --- a/kernel-auth/auth-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/auth/autoconfigure/SecurityAutoConfiguration.java +++ b/kernel-auth/auth-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/auth/autoconfigure/SecurityAutoConfiguration.java @@ -19,7 +19,6 @@ import com.gitee.fubluesky.kernel.auth.api.pojo.AuthProperties; import com.gitee.fubluesky.kernel.auth.security.SecurityConfig; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; @@ -39,11 +38,8 @@ @ConditionalOnProperty(prefix = "kernel.auth", name = "securityConfigEnabled", matchIfMissing = true) public class SecurityAutoConfiguration { - @Autowired - private AuthProperties authProperties; - @Bean - public SecurityConfig securityConfig() { + public SecurityConfig securityConfig(AuthProperties authProperties) { return new SecurityConfig(authProperties); } diff --git a/kernel-auth/pom.xml b/kernel-auth/pom.xml index b3c1239..2c30a2a 100644 --- a/kernel-auth/pom.xml +++ b/kernel-auth/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-cache/cache-api/pom.xml b/kernel-cache/cache-api/pom.xml index 16318cd..e0cc089 100644 --- a/kernel-cache/cache-api/pom.xml +++ b/kernel-cache/cache-api/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-cache - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-cache/cache-redis-spring-boot-starter/pom.xml b/kernel-cache/cache-redis-spring-boot-starter/pom.xml index ef015f1..fa38601 100644 --- a/kernel-cache/cache-redis-spring-boot-starter/pom.xml +++ b/kernel-cache/cache-redis-spring-boot-starter/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-cache - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-cache/cache-sdk-redis/pom.xml b/kernel-cache/cache-sdk-redis/pom.xml index 2d322cd..aa28409 100644 --- a/kernel-cache/cache-sdk-redis/pom.xml +++ b/kernel-cache/cache-sdk-redis/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-cache - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-cache/pom.xml b/kernel-cache/pom.xml index 6220abb..b9f0c99 100644 --- a/kernel-cache/pom.xml +++ b/kernel-cache/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-core/pom.xml b/kernel-core/pom.xml index f29c76a..6bf674b 100644 --- a/kernel-core/pom.xml +++ b/kernel-core/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-core/src/main/java/com/gitee/fubluesky/kernel/core/util/LocalDateTimeUtils.java b/kernel-core/src/main/java/com/gitee/fubluesky/kernel/core/util/LocalDateTimeUtils.java index 164d8d0..00ba6d4 100644 --- a/kernel-core/src/main/java/com/gitee/fubluesky/kernel/core/util/LocalDateTimeUtils.java +++ b/kernel-core/src/main/java/com/gitee/fubluesky/kernel/core/util/LocalDateTimeUtils.java @@ -26,6 +26,7 @@ /** * LocalDateTime 工具类 + * * @author yanghq * @version 1.0 * @since 2022-03-02 13:11 @@ -33,58 +34,58 @@ @UtilityClass public class LocalDateTimeUtils { - /** - * 获取年开始时间 - * @param date 时间 - * @return 年开始时间 - */ - public LocalDateTime beginOfYear(LocalDateTime date) { - return LocalDateTime.of(LocalDate.from(date.with(TemporalAdjusters.firstDayOfYear())), LocalTime.MIN); - } + /** + * 获取年开始时间 + * @param date 时间 + * @return 年开始时间 + */ + public LocalDateTime beginOfYear(LocalDateTime date) { + return LocalDateTime.of(LocalDate.from(date.with(TemporalAdjusters.firstDayOfYear())), LocalTime.MIN); + } + /** + * 获取年结束时间 + * @param date 时间 + * @return 年结束时间 + */ + public LocalDateTime endOfYear(LocalDateTime date) { + return LocalDateTime.of(LocalDate.from(date.with(TemporalAdjusters.lastDayOfYear())), LocalTime.MAX); + } - /** - * 获取年结束时间 - * @param date 时间 - * @return 年结束时间 - */ - public LocalDateTime endOfYear(LocalDateTime date) { - return LocalDateTime.of(LocalDate.from(date.with(TemporalAdjusters.lastDayOfYear())), LocalTime.MAX); - } + /** + * 获取月开始时间 + * @param date 时间 + * @return 月开始时间 + */ + public static LocalDateTime beginOfMonth(LocalDateTime date) { + return LocalDateTime.of(LocalDate.from(date.with(TemporalAdjusters.firstDayOfMonth())), LocalTime.MIN); + } - /** - * 获取月开始时间 - * @param date 时间 - * @return 月开始时间 - */ - public static LocalDateTime beginOfMonth(LocalDateTime date) { - return LocalDateTime.of(LocalDate.from(date.with(TemporalAdjusters.firstDayOfMonth())), LocalTime.MIN); - } + /** + * 获取月结束时间 + * @param date 时间 + * @return 月结束时间 + */ + public static LocalDateTime endOfMonth(LocalDateTime date) { + return LocalDateTime.of(LocalDate.from(date.with(TemporalAdjusters.lastDayOfMonth())), LocalTime.MAX); + } - /** - * 获取月结束时间 - * @param date 时间 - * @return 月结束时间 - */ - public static LocalDateTime endOfMonth(LocalDateTime date) { - return LocalDateTime.of(LocalDate.from(date.with(TemporalAdjusters.lastDayOfMonth())), LocalTime.MAX); - } + /** + * 获取日开始时间 + * @param date 时间 + * @return 日开始时间 + */ + public static LocalDateTime beginOfDay(LocalDateTime date) { + return date.with(LocalTime.MIN); + } - /** - * 获取日开始时间 - * @param date 时间 - * @return 日开始时间 - */ - public static LocalDateTime beginOfDay(LocalDateTime date) { - return date.with(LocalTime.MIN); - } + /** + * 获取日结束时间 + * @param date 时间 + * @return 日结束时间 + */ + public static LocalDateTime endOfDay(LocalDateTime date) { + return date.with(LocalTime.MAX); + } - /** - * 获取日结束时间 - * @param date 时间 - * @return 日结束时间 - */ - public static LocalDateTime endOfDay(LocalDateTime date) { - return date.with(LocalTime.MAX); - } } diff --git a/kernel-db/db-api/pom.xml b/kernel-db/db-api/pom.xml index a5d11e3..4639143 100644 --- a/kernel-db/db-api/pom.xml +++ b/kernel-db/db-api/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-db - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-db/db-sdk-mybatis-plus/pom.xml b/kernel-db/db-sdk-mybatis-plus/pom.xml index 7c9e4c7..176bec1 100644 --- a/kernel-db/db-sdk-mybatis-plus/pom.xml +++ b/kernel-db/db-sdk-mybatis-plus/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-db - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-db/db-spring-boot-starter/pom.xml b/kernel-db/db-spring-boot-starter/pom.xml index 042d2ad..a7b6f2a 100644 --- a/kernel-db/db-spring-boot-starter/pom.xml +++ b/kernel-db/db-spring-boot-starter/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-db - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-db/pom.xml b/kernel-db/pom.xml index 006abb8..607c36a 100644 --- a/kernel-db/pom.xml +++ b/kernel-db/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-email/email-api/pom.xml b/kernel-email/email-api/pom.xml index a811129..8bd25aa 100644 --- a/kernel-email/email-api/pom.xml +++ b/kernel-email/email-api/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-email - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-email/email-sdk-java/pom.xml b/kernel-email/email-sdk-java/pom.xml index aded416..432d08e 100644 --- a/kernel-email/email-sdk-java/pom.xml +++ b/kernel-email/email-sdk-java/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-email - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-email/email-spring-boot-starter/pom.xml b/kernel-email/email-spring-boot-starter/pom.xml index e8a7cee..b1e56ba 100644 --- a/kernel-email/email-spring-boot-starter/pom.xml +++ b/kernel-email/email-spring-boot-starter/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-email - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-email/email-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/email/autoconfigure/MailAutoConfiguration.java b/kernel-email/email-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/email/autoconfigure/MailAutoConfiguration.java index cf76aaa..2faf7dd 100644 --- a/kernel-email/email-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/email/autoconfigure/MailAutoConfiguration.java +++ b/kernel-email/email-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/email/autoconfigure/MailAutoConfiguration.java @@ -20,7 +20,6 @@ import com.gitee.fubluesky.kernel.email.api.MailSenderApi; import com.gitee.fubluesky.kernel.email.api.pojo.MailProperties; import com.gitee.fubluesky.kernel.email.java.JavaMailSender; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -43,12 +42,9 @@ public MailProperties mailProperties() { return new MailProperties(); } - @Autowired - private MailProperties mailProperties; - @Bean @ConditionalOnMissingBean(MailSenderApi.class) - public MailSenderApi mailSenderApi() { + public MailSenderApi mailSenderApi(MailProperties mailProperties) { return new JavaMailSender(mailProperties); } diff --git a/kernel-email/pom.xml b/kernel-email/pom.xml index 890ec57..f8fd057 100644 --- a/kernel-email/pom.xml +++ b/kernel-email/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-excel/excel-api/pom.xml b/kernel-excel/excel-api/pom.xml index c35676c..e9d301e 100644 --- a/kernel-excel/excel-api/pom.xml +++ b/kernel-excel/excel-api/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-excel - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-excel/excel-sdk-easy/pom.xml b/kernel-excel/excel-sdk-easy/pom.xml index 1916bcd..eca2df4 100644 --- a/kernel-excel/excel-sdk-easy/pom.xml +++ b/kernel-excel/excel-sdk-easy/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-excel - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-excel/excel-spring-boot-starter/pom.xml b/kernel-excel/excel-spring-boot-starter/pom.xml index e18c8cb..202d342 100644 --- a/kernel-excel/excel-spring-boot-starter/pom.xml +++ b/kernel-excel/excel-spring-boot-starter/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-excel - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-excel/pom.xml b/kernel-excel/pom.xml index e322999..9714899 100644 --- a/kernel-excel/pom.xml +++ b/kernel-excel/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-file/file-ali-spring-boot-starter/pom.xml b/kernel-file/file-ali-spring-boot-starter/pom.xml index b02e3cd..ce8a4dd 100644 --- a/kernel-file/file-ali-spring-boot-starter/pom.xml +++ b/kernel-file/file-ali-spring-boot-starter/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-file - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-file/file-ali-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/ali/autoconfigure/AliOssAutoConfiguration.java b/kernel-file/file-ali-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/ali/autoconfigure/AliOssAutoConfiguration.java index c200feb..cfa6f31 100644 --- a/kernel-file/file-ali-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/ali/autoconfigure/AliOssAutoConfiguration.java +++ b/kernel-file/file-ali-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/ali/autoconfigure/AliOssAutoConfiguration.java @@ -20,7 +20,6 @@ import com.gitee.fubluesky.kernel.file.ali.AliFileOperator; import com.gitee.fubluesky.kernel.file.ali.pojo.AliOssProperties; import com.gitee.fubluesky.kernel.file.api.FileOperatorApi; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -43,12 +42,9 @@ public AliOssProperties aliOssProperties() { return new AliOssProperties(); } - @Autowired - private AliOssProperties aliOssProperties; - @Bean @ConditionalOnMissingBean(FileOperatorApi.class) - public FileOperatorApi fileOperatorApi() { + public FileOperatorApi fileOperatorApi(AliOssProperties aliOssProperties) { return new AliFileOperator(aliOssProperties); } diff --git a/kernel-file/file-all-spring-boot-starter/pom.xml b/kernel-file/file-all-spring-boot-starter/pom.xml index a0a2c03..f0abc82 100644 --- a/kernel-file/file-all-spring-boot-starter/pom.xml +++ b/kernel-file/file-all-spring-boot-starter/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-file - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-file/file-all-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/all/autoconfigure/AllAutoConfiguration.java b/kernel-file/file-all-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/all/autoconfigure/AllAutoConfiguration.java index a2cad69..06061bf 100644 --- a/kernel-file/file-all-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/all/autoconfigure/AllAutoConfiguration.java +++ b/kernel-file/file-all-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/all/autoconfigure/AllAutoConfiguration.java @@ -22,7 +22,6 @@ import com.gitee.fubluesky.kernel.file.api.FileOperatorApi; import com.gitee.fubluesky.kernel.file.ftp.FtpFileOperator; import com.gitee.fubluesky.kernel.file.ftp.pojo.FtpFileProperties; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -51,23 +50,17 @@ public FtpFileProperties ftpFileProperties() { return new FtpFileProperties(); } - @Autowired - private AliOssProperties aliOssProperties; - - @Autowired - private FtpFileProperties ftpFileProperties; - @Bean("aliFileOperator") @ConditionalOnProperty(prefix = "kernel.file.ali", name = "enabled", havingValue = "true") @ConditionalOnMissingBean(name = "aliFileOperator") - public FileOperatorApi aliFileOperator() { + public FileOperatorApi aliFileOperator(AliOssProperties aliOssProperties) { return new AliFileOperator(aliOssProperties); } @Bean("ftpFileOperator") @ConditionalOnProperty(prefix = "kernel.file.ftp", name = "enabled", havingValue = "true") @ConditionalOnMissingBean(name = "ftpFileOperator") - public FileOperatorApi ftpFileOperator() { + public FileOperatorApi ftpFileOperator(FtpFileProperties ftpFileProperties) { return new FtpFileOperator(ftpFileProperties); } diff --git a/kernel-file/file-all-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/all/autoconfigure/FileStaticConfig.java b/kernel-file/file-all-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/all/autoconfigure/FileStaticConfig.java index 0aa68f3..8f16e18 100644 --- a/kernel-file/file-all-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/all/autoconfigure/FileStaticConfig.java +++ b/kernel-file/file-all-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/all/autoconfigure/FileStaticConfig.java @@ -20,10 +20,9 @@ import com.gitee.fubluesky.kernel.file.api.FileOperatorApi; import com.gitee.fubluesky.kernel.file.local.LocalFileOperator; import com.gitee.fubluesky.kernel.file.local.pojo.LocalFileProperties; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; @@ -37,18 +36,15 @@ * @since 2021-08-02 17:07 */ @ConditionalOnProperty(prefix = "kernel.file.local", name = "enabled", havingValue = "true") +@EnableConfigurationProperties(LocalFileSpringProperties.class) @Configuration public class FileStaticConfig implements WebMvcConfigurer { - @Bean - @ConfigurationProperties(prefix = "kernel.file.local") - @ConditionalOnMissingBean(LocalFileProperties.class) - public LocalFileProperties localFileProperties() { - return new LocalFileProperties(); - } + private final LocalFileProperties localFileProperties; - @Autowired - private LocalFileProperties localFileProperties; + public FileStaticConfig(LocalFileSpringProperties localFileProperties) { + this.localFileProperties = localFileProperties; + } @Bean("localFileOperator") @ConditionalOnMissingBean(name = "localFileOperator") diff --git a/kernel-file/file-all-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/all/autoconfigure/LocalFileSpringProperties.java b/kernel-file/file-all-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/all/autoconfigure/LocalFileSpringProperties.java new file mode 100644 index 0000000..ba640cb --- /dev/null +++ b/kernel-file/file-all-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/all/autoconfigure/LocalFileSpringProperties.java @@ -0,0 +1,35 @@ +/* + * + * Copyright 2021 fubluesky. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * 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 com.gitee.fubluesky.kernel.file.all.autoconfigure; + +import com.gitee.fubluesky.kernel.file.local.pojo.LocalFileProperties; +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.io.Serializable; + +/** + * @author yanghq + * @version 1.0 + * @since 2022-03-10 11:44 + */ +@ConfigurationProperties(prefix = "kernel.file.local") +public class LocalFileSpringProperties extends LocalFileProperties implements Serializable { + + private static final long serialVersionUID = -3702694512869108639L; + +} diff --git a/kernel-file/file-api/pom.xml b/kernel-file/file-api/pom.xml index c0ed735..f180445 100644 --- a/kernel-file/file-api/pom.xml +++ b/kernel-file/file-api/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-file - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-file/file-expand-apk/pom.xml b/kernel-file/file-expand-apk/pom.xml index 038fc1c..b0bafe8 100644 --- a/kernel-file/file-expand-apk/pom.xml +++ b/kernel-file/file-expand-apk/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-file - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-file/file-ftp-spring-boot-starter/pom.xml b/kernel-file/file-ftp-spring-boot-starter/pom.xml index a9c4f91..c0d18d2 100644 --- a/kernel-file/file-ftp-spring-boot-starter/pom.xml +++ b/kernel-file/file-ftp-spring-boot-starter/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-file - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-file/file-ftp-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/ftp/autoconfigure/FtpFileAutoConfiguration.java b/kernel-file/file-ftp-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/ftp/autoconfigure/FtpFileAutoConfiguration.java index a3f782a..55cdb48 100644 --- a/kernel-file/file-ftp-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/ftp/autoconfigure/FtpFileAutoConfiguration.java +++ b/kernel-file/file-ftp-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/ftp/autoconfigure/FtpFileAutoConfiguration.java @@ -20,7 +20,6 @@ import com.gitee.fubluesky.kernel.file.api.FileOperatorApi; import com.gitee.fubluesky.kernel.file.ftp.FtpFileOperator; import com.gitee.fubluesky.kernel.file.ftp.pojo.FtpFileProperties; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -43,12 +42,9 @@ public FtpFileProperties ftpFileProperties() { return new FtpFileProperties(); } - @Autowired - private FtpFileProperties ftpFileProperties; - @Bean @ConditionalOnMissingBean(FileOperatorApi.class) - public FileOperatorApi fileOperatorApi() { + public FileOperatorApi fileOperatorApi(FtpFileProperties ftpFileProperties) { return new FtpFileOperator(ftpFileProperties); } diff --git a/kernel-file/file-local-spring-boot-starter/pom.xml b/kernel-file/file-local-spring-boot-starter/pom.xml index 28f73dc..eadf100 100644 --- a/kernel-file/file-local-spring-boot-starter/pom.xml +++ b/kernel-file/file-local-spring-boot-starter/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-file - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-file/file-local-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/local/autoconfigure/FileStaticConfig.java b/kernel-file/file-local-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/local/autoconfigure/FileStaticConfig.java index b288a7a..1dbef61 100644 --- a/kernel-file/file-local-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/local/autoconfigure/FileStaticConfig.java +++ b/kernel-file/file-local-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/local/autoconfigure/FileStaticConfig.java @@ -17,12 +17,12 @@ package com.gitee.fubluesky.kernel.file.local.autoconfigure; +import com.gitee.fubluesky.kernel.file.api.FileOperatorApi; +import com.gitee.fubluesky.kernel.file.local.LocalFileOperator; import com.gitee.fubluesky.kernel.file.local.pojo.LocalFileProperties; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; @@ -36,19 +36,21 @@ * @since 2021-08-02 17:07 */ @ConditionalOnProperty(prefix = "kernel.file.local", name = "enabled", matchIfMissing = true) -@AutoConfigureBefore(LocalFileAutoConfiguration.class) +@EnableConfigurationProperties(LocalFileSpringProperties.class) @Configuration public class FileStaticConfig implements WebMvcConfigurer { - @Bean - @ConfigurationProperties(prefix = "kernel.file.local") - @ConditionalOnMissingBean(LocalFileProperties.class) - public LocalFileProperties localFileProperties() { - return new LocalFileProperties(); + private final LocalFileProperties localFileProperties; + + public FileStaticConfig(LocalFileSpringProperties localFileProperties) { + this.localFileProperties = localFileProperties; } - @Autowired - private LocalFileProperties localFileProperties; + @Bean + @ConditionalOnMissingBean(FileOperatorApi.class) + public FileOperatorApi fileOperatorApi() { + return new LocalFileOperator(localFileProperties); + } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { diff --git a/kernel-file/file-local-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/local/autoconfigure/LocalFileAutoConfiguration.java b/kernel-file/file-local-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/local/autoconfigure/LocalFileAutoConfiguration.java deleted file mode 100644 index 6cffbf9..0000000 --- a/kernel-file/file-local-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/local/autoconfigure/LocalFileAutoConfiguration.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Copyright 2021 fubluesky. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * 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 com.gitee.fubluesky.kernel.file.local.autoconfigure; - -import com.gitee.fubluesky.kernel.file.api.FileOperatorApi; -import com.gitee.fubluesky.kernel.file.local.LocalFileOperator; -import com.gitee.fubluesky.kernel.file.local.pojo.LocalFileProperties; -import org.springframework.beans.factory.annotation.Autowired; -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; - -/** - * 本地文件服务 配置 - * - * @author yanghq - * @version 1.0 - * @since 2021-08-02 14:09 - */ -@Configuration -@ConditionalOnProperty(prefix = "kernel.file.local", name = "enabled", matchIfMissing = true) -public class LocalFileAutoConfiguration { - - @Autowired - private LocalFileProperties localFileProperties; - - @Bean - @ConditionalOnMissingBean(FileOperatorApi.class) - public FileOperatorApi fileOperatorApi() { - return new LocalFileOperator(localFileProperties); - } - -} diff --git a/kernel-file/file-local-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/local/autoconfigure/LocalFileSpringProperties.java b/kernel-file/file-local-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/local/autoconfigure/LocalFileSpringProperties.java new file mode 100644 index 0000000..b43cd90 --- /dev/null +++ b/kernel-file/file-local-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/file/local/autoconfigure/LocalFileSpringProperties.java @@ -0,0 +1,35 @@ +/* + * + * Copyright 2021 fubluesky. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * 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 com.gitee.fubluesky.kernel.file.local.autoconfigure; + +import com.gitee.fubluesky.kernel.file.local.pojo.LocalFileProperties; +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.io.Serializable; + +/** + * @author yanghq + * @version 1.0 + * @since 2022-03-10 11:44 + */ +@ConfigurationProperties(prefix = "kernel.file.local") +public class LocalFileSpringProperties extends LocalFileProperties implements Serializable { + + private static final long serialVersionUID = -3702694512869108639L; + +} diff --git a/kernel-file/file-local-spring-boot-starter/src/main/resources/META-INF/spring.factories b/kernel-file/file-local-spring-boot-starter/src/main/resources/META-INF/spring.factories index de9e510..c401005 100644 --- a/kernel-file/file-local-spring-boot-starter/src/main/resources/META-INF/spring.factories +++ b/kernel-file/file-local-spring-boot-starter/src/main/resources/META-INF/spring.factories @@ -1,3 +1,2 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - com.gitee.fubluesky.kernel.file.local.autoconfigure.LocalFileAutoConfiguration,\ com.gitee.fubluesky.kernel.file.local.autoconfigure.FileStaticConfig \ No newline at end of file diff --git a/kernel-file/file-sdk-ali/pom.xml b/kernel-file/file-sdk-ali/pom.xml index eec8f4d..e28b826 100644 --- a/kernel-file/file-sdk-ali/pom.xml +++ b/kernel-file/file-sdk-ali/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-file - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-file/file-sdk-ftp/pom.xml b/kernel-file/file-sdk-ftp/pom.xml index 9e3bf1e..5ebbf7e 100644 --- a/kernel-file/file-sdk-ftp/pom.xml +++ b/kernel-file/file-sdk-ftp/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-file - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-file/file-sdk-local/pom.xml b/kernel-file/file-sdk-local/pom.xml index 0a6d8f9..a4fda6c 100644 --- a/kernel-file/file-sdk-local/pom.xml +++ b/kernel-file/file-sdk-local/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-file - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-file/pom.xml b/kernel-file/pom.xml index 84df764..73c17b6 100644 --- a/kernel-file/pom.xml +++ b/kernel-file/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-jwt/jwt-api/pom.xml b/kernel-jwt/jwt-api/pom.xml index 6a602d3..f9c4edd 100644 --- a/kernel-jwt/jwt-api/pom.xml +++ b/kernel-jwt/jwt-api/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-jwt - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-jwt/jwt-sdk/pom.xml b/kernel-jwt/jwt-sdk/pom.xml index 5ca1d33..2f0b034 100644 --- a/kernel-jwt/jwt-sdk/pom.xml +++ b/kernel-jwt/jwt-sdk/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-jwt - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-jwt/jwt-spring-boot-starter/pom.xml b/kernel-jwt/jwt-spring-boot-starter/pom.xml index 76a7ab0..c959633 100644 --- a/kernel-jwt/jwt-spring-boot-starter/pom.xml +++ b/kernel-jwt/jwt-spring-boot-starter/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-jwt - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-jwt/jwt-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/jwt/autoconfigure/JwtAutoConfiguration.java b/kernel-jwt/jwt-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/jwt/autoconfigure/JwtAutoConfiguration.java index 35ccda2..be8f8bc 100644 --- a/kernel-jwt/jwt-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/jwt/autoconfigure/JwtAutoConfiguration.java +++ b/kernel-jwt/jwt-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/jwt/autoconfigure/JwtAutoConfiguration.java @@ -20,7 +20,6 @@ import com.gitee.fubluesky.kernel.jwt.JwtTokenOperator; import com.gitee.fubluesky.kernel.jwt.api.JwtApi; import com.gitee.fubluesky.kernel.jwt.api.pojo.JwtProperties; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -43,12 +42,9 @@ public JwtProperties jwtConfig() { return new JwtProperties(); } - @Autowired - private JwtProperties jwtProperties; - @Bean @ConditionalOnMissingBean(JwtApi.class) - public JwtApi jwtApi() { + public JwtApi jwtApi(JwtProperties jwtProperties) { return new JwtTokenOperator(jwtProperties); } diff --git a/kernel-jwt/pom.xml b/kernel-jwt/pom.xml index 956eb49..8d4f06d 100644 --- a/kernel-jwt/pom.xml +++ b/kernel-jwt/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-parent/pom.xml b/kernel-parent/pom.xml index 98a2208..a8d916d 100644 --- a/kernel-parent/pom.xml +++ b/kernel-parent/pom.xml @@ -23,7 +23,7 @@ com.gitee.fubluesky kernel-parent pom - 1.6.6 + 1.6.7 2021-Now kernel-parent kernel-parent @@ -37,13 +37,13 @@ 1.8 - 2.5.10 + 2.6.4 - 2020.0.4 - 2021.1 + 2021.0.1 + 2021.0.1.0 1.6.3 - 1.6.5 + 1.6.7 3.1.0 diff --git a/kernel-push/pom.xml b/kernel-push/pom.xml index fa5c002..805d5cb 100644 --- a/kernel-push/pom.xml +++ b/kernel-push/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-push/push-api/pom.xml b/kernel-push/push-api/pom.xml index a5982d0..36f4dc7 100644 --- a/kernel-push/push-api/pom.xml +++ b/kernel-push/push-api/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-push - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-push/push-sdk-jpush/pom.xml b/kernel-push/push-sdk-jpush/pom.xml index d72a262..0f7a4a3 100644 --- a/kernel-push/push-sdk-jpush/pom.xml +++ b/kernel-push/push-sdk-jpush/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-push - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-push/push-spring-boot-starter/pom.xml b/kernel-push/push-spring-boot-starter/pom.xml index 4fe32be..1fbf379 100644 --- a/kernel-push/push-spring-boot-starter/pom.xml +++ b/kernel-push/push-spring-boot-starter/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-push - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-push/push-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/push/autoconfigure/JpushAutoConfiguration.java b/kernel-push/push-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/push/autoconfigure/JpushAutoConfiguration.java index 661b174..01e6f2b 100644 --- a/kernel-push/push-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/push/autoconfigure/JpushAutoConfiguration.java +++ b/kernel-push/push-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/push/autoconfigure/JpushAutoConfiguration.java @@ -20,7 +20,6 @@ import com.gitee.fubluesky.kernel.push.api.PushApi; import com.gitee.fubluesky.kernel.push.jpush.JpushService; import com.gitee.fubluesky.kernel.push.jpush.pojo.JpushProperties; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -43,12 +42,9 @@ public JpushProperties jpushProperties() { return new JpushProperties(); } - @Autowired - private JpushProperties jpushProperties; - @Bean @ConditionalOnMissingBean(PushApi.class) - public PushApi pushApi() { + public PushApi pushApi(JpushProperties jpushProperties) { return new JpushService(jpushProperties); } diff --git a/kernel-security/pom.xml b/kernel-security/pom.xml index 4b90bd7..46e12dd 100644 --- a/kernel-security/pom.xml +++ b/kernel-security/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-security/security-api/pom.xml b/kernel-security/security-api/pom.xml index 11853ba..27cba35 100644 --- a/kernel-security/security-api/pom.xml +++ b/kernel-security/security-api/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-security - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-security/security-sdk-captcha/pom.xml b/kernel-security/security-sdk-captcha/pom.xml index e7c1d68..d696d2b 100644 --- a/kernel-security/security-sdk-captcha/pom.xml +++ b/kernel-security/security-sdk-captcha/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-security - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-security/security-sdk-cors/pom.xml b/kernel-security/security-sdk-cors/pom.xml index a05e485..a729452 100644 --- a/kernel-security/security-sdk-cors/pom.xml +++ b/kernel-security/security-sdk-cors/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-security - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-security/security-sdk-jackson/pom.xml b/kernel-security/security-sdk-jackson/pom.xml index c4fb84d..5a2ab11 100644 --- a/kernel-security/security-sdk-jackson/pom.xml +++ b/kernel-security/security-sdk-jackson/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-security - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-security/security-sdk-sign/pom.xml b/kernel-security/security-sdk-sign/pom.xml index 13ea789..21693be 100644 --- a/kernel-security/security-sdk-sign/pom.xml +++ b/kernel-security/security-sdk-sign/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-security - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-security/security-spring-boot-starter/pom.xml b/kernel-security/security-spring-boot-starter/pom.xml index 38d4484..e5d30a7 100644 --- a/kernel-security/security-spring-boot-starter/pom.xml +++ b/kernel-security/security-spring-boot-starter/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-security - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-security/security-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/security/autoconfigure/CorsAutoConfiguration.java b/kernel-security/security-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/security/autoconfigure/CorsAutoConfiguration.java index 74f29a4..f22772f 100644 --- a/kernel-security/security-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/security/autoconfigure/CorsAutoConfiguration.java +++ b/kernel-security/security-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/security/autoconfigure/CorsAutoConfiguration.java @@ -19,7 +19,6 @@ import com.gitee.fubluesky.kernel.security.cors.pojo.CorsProperties; import com.gitee.fubluesky.kernel.security.cors.utils.CorsUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -44,11 +43,8 @@ public CorsProperties corsProperties() { return new CorsProperties(); } - @Autowired - private CorsProperties corsProperties; - @Bean - public FilterRegistrationBean corsFilter() { + public FilterRegistrationBean corsFilter(CorsProperties corsProperties) { return new CorsUtils(corsProperties).getCorsFilter(); } diff --git a/kernel-security/security-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/security/autoconfigure/JacksonConfiguration.java b/kernel-security/security-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/security/autoconfigure/JacksonConfiguration.java index b1a3a50..4727d5b 100644 --- a/kernel-security/security-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/security/autoconfigure/JacksonConfiguration.java +++ b/kernel-security/security-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/security/autoconfigure/JacksonConfiguration.java @@ -26,7 +26,6 @@ import com.gitee.fubluesky.kernel.security.jackson.module.DefaultJavaTimeModule; import com.gitee.fubluesky.kernel.security.jackson.module.TimestampsJavaTimeModule; import com.gitee.fubluesky.kernel.security.jackson.pojo.PlatformJacksonProperties; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -58,14 +57,9 @@ public PlatformJacksonProperties platformJacksonProperties() { return new PlatformJacksonProperties(); } - @Autowired - private PlatformJacksonProperties platformJacksonProperties; - - @Autowired - private Jackson2ObjectMapperBuilder builder; - @Bean - public ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder) { + public ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder, + PlatformJacksonProperties platformJacksonProperties) { builder.simpleDateFormat(PlatformJacksonConstant.PATTERN_DATETIME); // 创建ObjectMapper ObjectMapper objectMapper = builder.createXmlMapper(false).build(); diff --git a/kernel-sms/pom.xml b/kernel-sms/pom.xml index 7efa6c8..d627bd5 100644 --- a/kernel-sms/pom.xml +++ b/kernel-sms/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-sms/sms-ali-spring-boot-starter/pom.xml b/kernel-sms/sms-ali-spring-boot-starter/pom.xml index 02c1e51..d581230 100644 --- a/kernel-sms/sms-ali-spring-boot-starter/pom.xml +++ b/kernel-sms/sms-ali-spring-boot-starter/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-sms - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-sms/sms-ali-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/sms/ali/autoconfigure/AliSmsAutoConfiguration.java b/kernel-sms/sms-ali-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/sms/ali/autoconfigure/AliSmsAutoConfiguration.java index 68330bd..4e89682 100644 --- a/kernel-sms/sms-ali-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/sms/ali/autoconfigure/AliSmsAutoConfiguration.java +++ b/kernel-sms/sms-ali-spring-boot-starter/src/main/java/com/gitee/fubluesky/kernel/sms/ali/autoconfigure/AliSmsAutoConfiguration.java @@ -20,7 +20,6 @@ import com.gitee.fubluesky.kernel.sms.ali.AliSmsSender; import com.gitee.fubluesky.kernel.sms.ali.pojo.AliSmsProperties; import com.gitee.fubluesky.kernel.sms.api.SmsSenderApi; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -43,12 +42,9 @@ public AliSmsProperties aliSmsProperties() { return new AliSmsProperties(); } - @Autowired - private AliSmsProperties aliSmsProperties; - @Bean @ConditionalOnMissingBean(SmsSenderApi.class) - public SmsSenderApi smsSenderApi() { + public SmsSenderApi smsSenderApi(AliSmsProperties aliSmsProperties) { return new AliSmsSender(aliSmsProperties); } diff --git a/kernel-sms/sms-api/pom.xml b/kernel-sms/sms-api/pom.xml index f27a427..41e8f98 100644 --- a/kernel-sms/sms-api/pom.xml +++ b/kernel-sms/sms-api/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-sms - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-sms/sms-sdk-ali/pom.xml b/kernel-sms/sms-sdk-ali/pom.xml index 6796613..ed10e13 100644 --- a/kernel-sms/sms-sdk-ali/pom.xml +++ b/kernel-sms/sms-sdk-ali/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-sms - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-validator/pom.xml b/kernel-validator/pom.xml index 10f4a8e..afaad75 100644 --- a/kernel-validator/pom.xml +++ b/kernel-validator/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel - 1.6.6 + 1.6.7 4.0.0 diff --git a/kernel-validator/validator-api/pom.xml b/kernel-validator/validator-api/pom.xml index a4b8e56..2ae118d 100644 --- a/kernel-validator/validator-api/pom.xml +++ b/kernel-validator/validator-api/pom.xml @@ -20,7 +20,7 @@ com.gitee.fubluesky.kernel kernel-validator - 1.6.6 + 1.6.7 4.0.0 diff --git a/pom.xml b/pom.xml index 1de9f23..5f774f2 100644 --- a/pom.xml +++ b/pom.xml @@ -23,14 +23,14 @@ com.gitee.fubluesky kernel-parent - 1.6.6 + 1.6.7 com.gitee.fubluesky.kernel kernel pom - 1.6.6 + 1.6.7 2021-Now kernel kernel