refactor: 使用常量优化部分配置属性名

This commit is contained in:
2024-01-02 22:14:00 +08:00
parent 1f3687df6f
commit 20250681da
15 changed files with 109 additions and 15 deletions

View File

@@ -21,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
/**
* 图形验证码自动配置
@@ -31,7 +32,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
@Slf4j
@AutoConfiguration
@EnableConfigurationProperties(GraphicCaptchaProperties.class)
@ConditionalOnProperty(prefix = "continew-starter.captcha.graphic", name = "enabled", havingValue = "true")
@ConditionalOnProperty(prefix = PropertiesConstants.CAPTCHA_GRAPHIC, name = PropertiesConstants.ENABLED, havingValue = "true")
public class GraphicCaptchaAutoConfiguration {
@PostConstruct

View File

@@ -22,6 +22,7 @@ import com.wf.captcha.base.Captcha;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import top.charles7c.continew.starter.captcha.graphic.enums.GraphicCaptchaType;
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
import java.awt.*;
@@ -32,7 +33,7 @@ import java.awt.*;
* @since 1.0.0
*/
@Data
@ConfigurationProperties(prefix = "continew-starter.captcha.graphic")
@ConfigurationProperties(PropertiesConstants.CAPTCHA_GRAPHIC)
public class GraphicCaptchaProperties {
/**