refactor: 优化部分代码

1.修复 Sonar 扫描问题
2.使用常量替代部分魔法值
This commit is contained in:
2024-01-27 23:10:27 +08:00
parent ef0e99de83
commit 75fe5377df
9 changed files with 102 additions and 61 deletions

View File

@@ -32,6 +32,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.context.annotation.*;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
import top.charles7c.continew.starter.core.constant.StringConstants;
import top.charles7c.continew.starter.core.util.GeneralPropertySourceFactory;
@@ -46,7 +47,7 @@ import top.charles7c.continew.starter.core.util.GeneralPropertySourceFactory;
@RequiredArgsConstructor
@ComponentScan("top.charles7c.continew.starter.auth.satoken.exception")
@EnableConfigurationProperties(SaTokenExtensionProperties.class)
@ConditionalOnProperty(prefix = "sa-token.extension", name = "enabled", havingValue = "true")
@ConditionalOnProperty(prefix = "sa-token.extension", name = PropertiesConstants.ENABLED, havingValue = "true")
@PropertySource(value = "classpath:default-auth-satoken.yml", factory = GeneralPropertySourceFactory.class)
public class SaTokenAutoConfiguration implements WebMvcConfigurer {