Skip to content

Commit

Permalink
Merge pull request #24 from guoshiqiufeng/dev
Browse files Browse the repository at this point in the history
1.6.7
  • Loading branch information
guoshiqiufeng authored Mar 10, 2022
2 parents 5580e4b + 9b88e9a commit 26d9702
Show file tree
Hide file tree
Showing 76 changed files with 221 additions and 279 deletions.
1 change: 1 addition & 0 deletions .springjavaformatconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
java-baseline=8
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`格式化代码
Expand Down
4 changes: 2 additions & 2 deletions kernel-all-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>kernel-all-spring-boot-starter</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
<description>spring-boot 依赖引用</description>
<inceptionYear>2021-Now</inceptionYear>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion kernel-auth/auth-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-auth</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-auth/auth-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-auth</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-auth/auth-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-auth</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<LoginUser> loginUserTokenCache;

@Autowired
private CacheOperatorApi<LoginUser> 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<LoginUser> loginUserTokenCache, CacheOperatorApi<LoginUser> loginUserCache,
CaptchaApi captchaApi, CaptchaProperties captchaProperties, JwtApi jwtApi) {
return new AuthImpl(authProperties, loginApi, passwordEncryptApi, loginUserTokenCache, loginUserCache,
captchaApi, captchaProperties, jwtApi);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -50,35 +49,26 @@ public AuthProperties authProperties() {
return new AuthProperties();
}

@Autowired
private AuthProperties authProperties;

@Bean
public RedisTemplate<String, LoginUser> loginUserRedisTemplate(RedisConnectionFactory redisConnectionFactory) {
return RedisCacheUtils.getObjectRedisTemplate(redisConnectionFactory);
}

@Autowired
private RedisTemplate<String, LoginUser> loginUserRedisTemplate;

@Bean
@ConditionalOnMissingBean(name = "loginUserTokenCache")
public CacheOperatorApi<LoginUser> loginUserTokenCache() {
public CacheOperatorApi<LoginUser> loginUserTokenCache(RedisTemplate<String, LoginUser> loginUserRedisTemplate) {
return new LoginUserTokenRedisCache(loginUserRedisTemplate);
}

@Bean
@ConditionalOnMissingBean(name = "loginUserCache")
public CacheOperatorApi<LoginUser> loginUserCache() {
public CacheOperatorApi<LoginUser> loginUserCache(RedisTemplate<String, LoginUser> loginUserRedisTemplate) {
return new LoginUserRedisCache(loginUserRedisTemplate);
}

@Autowired
private CacheOperatorApi<LoginUser> loginUserCache;

@Bean
@ConditionalOnMissingBean(LoginApi.class)
public LoginApi loginApi() {
public LoginApi loginApi(AuthProperties authProperties, CacheOperatorApi<LoginUser> loginUserCache) {
return new LoginImpl(authProperties, loginUserCache);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion kernel-auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-cache/cache-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-cache</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-cache/cache-redis-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-cache</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-cache/cache-sdk-redis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-cache</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,65 +26,66 @@

/**
* LocalDateTime 工具类
*
* @author yanghq
* @version 1.0
* @since 2022-03-02 13:11
*/
@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);
}
}
2 changes: 1 addition & 1 deletion kernel-db/db-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-db</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-db/db-sdk-mybatis-plus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-db</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-db/db-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-db</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-email/email-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-email</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kernel-email/email-sdk-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.gitee.fubluesky.kernel</groupId>
<artifactId>kernel-email</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Loading

0 comments on commit 26d9702

Please sign in to comment.