mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-10-24 18:57:13 +08:00
refactor: 优化部分代码
1.修复 Sonar 扫描问题 2.使用常量替代部分魔法值
This commit is contained in:
@@ -25,6 +25,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import top.charles7c.continew.starter.auth.justauth.core.JustAuthStateCacheRedisImpl;
|
||||
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
|
||||
/**
|
||||
* JustAuth 自动配置
|
||||
@@ -34,7 +35,7 @@ import top.charles7c.continew.starter.auth.justauth.core.JustAuthStateCacheRedis
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration(before = com.xkcoding.justauth.autoconfigure.JustAuthAutoConfiguration.class)
|
||||
@ConditionalOnProperty(prefix = "justauth", value = "enabled", havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(prefix = "justauth", name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true)
|
||||
public class JustAuthAutoConfiguration {
|
||||
|
||||
/**
|
||||
@@ -42,7 +43,7 @@ public class JustAuthAutoConfiguration {
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnClass(RedisClient.class)
|
||||
@ConditionalOnProperty(prefix = "justauth.cache", value = "type", havingValue = "redis")
|
||||
@ConditionalOnProperty(prefix = "justauth.cache", name = "type", havingValue = "redis")
|
||||
public AuthStateCache authStateCache() {
|
||||
JustAuthStateCacheRedisImpl impl = new JustAuthStateCacheRedisImpl();
|
||||
log.debug("[ContiNew Starter] - Auto Configuration 'JustAuth-AuthStateCache-Redis' completed initialization.");
|
||||
|
||||
Reference in New Issue
Block a user