mirror of
				https://github.com/continew-org/continew-starter.git
				synced 2025-11-04 09:01:40 +08:00 
			
		
		
		
	chore: 移除 lombok 依赖
再度精简依赖
This commit is contained in:
		@@ -17,7 +17,8 @@
 | 
			
		||||
package top.charles7c.continew.starter.captcha.graphic.autoconfigure;
 | 
			
		||||
 | 
			
		||||
import jakarta.annotation.PostConstruct;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.slf4j.Logger;
 | 
			
		||||
import org.slf4j.LoggerFactory;
 | 
			
		||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
 | 
			
		||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 | 
			
		||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
 | 
			
		||||
@@ -29,12 +30,13 @@ import top.charles7c.continew.starter.core.constant.PropertiesConstants;
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 1.0.0
 | 
			
		||||
 */
 | 
			
		||||
@Slf4j
 | 
			
		||||
@AutoConfiguration
 | 
			
		||||
@EnableConfigurationProperties(GraphicCaptchaProperties.class)
 | 
			
		||||
@ConditionalOnProperty(prefix = PropertiesConstants.CAPTCHA_GRAPHIC, name = PropertiesConstants.ENABLED, havingValue = "true")
 | 
			
		||||
public class GraphicCaptchaAutoConfiguration {
 | 
			
		||||
 | 
			
		||||
    private static final Logger log = LoggerFactory.getLogger(GraphicCaptchaAutoConfiguration.class);
 | 
			
		||||
 | 
			
		||||
    @PostConstruct
 | 
			
		||||
    public void postConstruct() {
 | 
			
		||||
        log.debug("[ContiNew Starter] - Auto Configuration 'Graphic Captcha' completed initialization.");
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,6 @@ package top.charles7c.continew.starter.captcha.graphic.autoconfigure;
 | 
			
		||||
import cn.hutool.core.util.ReflectUtil;
 | 
			
		||||
import cn.hutool.core.util.StrUtil;
 | 
			
		||||
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;
 | 
			
		||||
@@ -32,7 +31,6 @@ import java.awt.*;
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 1.0.0
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@ConfigurationProperties(PropertiesConstants.CAPTCHA_GRAPHIC)
 | 
			
		||||
public class GraphicCaptchaProperties {
 | 
			
		||||
 | 
			
		||||
@@ -87,4 +85,65 @@ public class GraphicCaptchaProperties {
 | 
			
		||||
        }
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public boolean isEnabled() {
 | 
			
		||||
        return enabled;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setEnabled(boolean enabled) {
 | 
			
		||||
        this.enabled = enabled;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public GraphicCaptchaType getType() {
 | 
			
		||||
        return type;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setType(GraphicCaptchaType type) {
 | 
			
		||||
        this.type = type;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public int getLength() {
 | 
			
		||||
        return length;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setLength(int length) {
 | 
			
		||||
        this.length = length;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public int getWidth() {
 | 
			
		||||
        return width;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setWidth(int width) {
 | 
			
		||||
        this.width = width;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public int getHeight() {
 | 
			
		||||
        return height;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setHeight(int height) {
 | 
			
		||||
        this.height = height;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getFontName() {
 | 
			
		||||
        return fontName;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setFontName(String fontName) {
 | 
			
		||||
        this.fontName = fontName;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public int getFontSize() {
 | 
			
		||||
        return fontSize;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setFontSize(int fontSize) {
 | 
			
		||||
        this.fontSize = fontSize;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return "GraphicCaptchaProperties{" + "enabled=" + enabled + ", type=" + type + ", length=" + length + ", width=" + width + ", height=" + height + ", fontName='" + fontName + '\'' + ", fontSize=" + fontSize + '}';
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -18,8 +18,6 @@ package top.charles7c.continew.starter.captcha.graphic.enums;
 | 
			
		||||
 | 
			
		||||
import com.wf.captcha.*;
 | 
			
		||||
import com.wf.captcha.base.Captcha;
 | 
			
		||||
import lombok.Getter;
 | 
			
		||||
import lombok.RequiredArgsConstructor;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 图形验证码类型枚举
 | 
			
		||||
@@ -27,8 +25,6 @@ import lombok.RequiredArgsConstructor;
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 1.0.0
 | 
			
		||||
 */
 | 
			
		||||
@Getter
 | 
			
		||||
@RequiredArgsConstructor
 | 
			
		||||
public enum GraphicCaptchaType {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -60,4 +56,12 @@ public enum GraphicCaptchaType {
 | 
			
		||||
     * 验证码实现
 | 
			
		||||
     */
 | 
			
		||||
    private final Class<? extends Captcha> captchaImpl;
 | 
			
		||||
 | 
			
		||||
    GraphicCaptchaType(Class<? extends Captcha> captchaImpl) {
 | 
			
		||||
        this.captchaImpl = captchaImpl;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Class<? extends Captcha> getCaptchaImpl() {
 | 
			
		||||
        return captchaImpl;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user