mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-08 16:57:09 +08:00
chore: 移除 lombok 依赖
再度精简依赖
This commit is contained in:
@@ -24,8 +24,8 @@ import com.anji.captcha.service.CaptchaService;
|
||||
import com.anji.captcha.service.impl.CaptchaServiceFactory;
|
||||
import com.anji.captcha.util.ImageUtils;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -48,15 +48,18 @@ import java.util.Properties;
|
||||
* @author Bull-BCLS
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnProperty(prefix = PropertiesConstants.CAPTCHA_BEHAVIOR, name = PropertiesConstants.ENABLED, havingValue = "true")
|
||||
@EnableConfigurationProperties(BehaviorCaptchaProperties.class)
|
||||
public class BehaviorCaptchaAutoConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BehaviorCaptchaAutoConfiguration.class);
|
||||
private final BehaviorCaptchaProperties properties;
|
||||
|
||||
public BehaviorCaptchaAutoConfiguration(BehaviorCaptchaProperties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义缓存实现配置
|
||||
*/
|
||||
|
@@ -21,8 +21,9 @@ import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.anji.captcha.service.CaptchaCacheService;
|
||||
import com.anji.captcha.service.impl.CaptchaServiceFactory;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.redisson.client.RedisClient;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
@@ -39,9 +40,10 @@ import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
* @author Bull-BCLS
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
abstract class BehaviorCaptchaCacheConfiguration {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BehaviorCaptchaCacheConfiguration.class);
|
||||
|
||||
private BehaviorCaptchaCacheConfiguration() {
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,6 @@ package top.charles7c.continew.starter.captcha.behavior.autoconfigure;
|
||||
|
||||
import com.anji.captcha.model.common.CaptchaTypeEnum;
|
||||
import com.anji.captcha.service.CaptchaCacheService;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import top.charles7c.continew.starter.captcha.behavior.enums.StorageType;
|
||||
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
|
||||
@@ -31,7 +30,6 @@ import java.awt.*;
|
||||
* @author Bull-BCLS
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(PropertiesConstants.CAPTCHA_BEHAVIOR)
|
||||
public class BehaviorCaptchaProperties {
|
||||
|
||||
@@ -149,4 +147,193 @@ public class BehaviorCaptchaProperties {
|
||||
* 点选字体大小(默认:25)
|
||||
*/
|
||||
private int fontSize = 25;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public Boolean getEnableAes() {
|
||||
return enableAes;
|
||||
}
|
||||
|
||||
public void setEnableAes(Boolean enableAes) {
|
||||
this.enableAes = enableAes;
|
||||
}
|
||||
|
||||
public CaptchaTypeEnum getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(CaptchaTypeEnum type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public StorageType getCacheType() {
|
||||
return cacheType;
|
||||
}
|
||||
|
||||
public void setCacheType(StorageType cacheType) {
|
||||
this.cacheType = cacheType;
|
||||
}
|
||||
|
||||
public Class<? extends CaptchaCacheService> getCacheImpl() {
|
||||
return cacheImpl;
|
||||
}
|
||||
|
||||
public void setCacheImpl(Class<? extends CaptchaCacheService> cacheImpl) {
|
||||
this.cacheImpl = cacheImpl;
|
||||
}
|
||||
|
||||
public String getJigsawBaseMapPath() {
|
||||
return jigsawBaseMapPath;
|
||||
}
|
||||
|
||||
public void setJigsawBaseMapPath(String jigsawBaseMapPath) {
|
||||
this.jigsawBaseMapPath = jigsawBaseMapPath;
|
||||
}
|
||||
|
||||
public String getSlipOffset() {
|
||||
return slipOffset;
|
||||
}
|
||||
|
||||
public void setSlipOffset(String slipOffset) {
|
||||
this.slipOffset = slipOffset;
|
||||
}
|
||||
|
||||
public String getPicClickBaseMapPath() {
|
||||
return picClickBaseMapPath;
|
||||
}
|
||||
|
||||
public void setPicClickBaseMapPath(String picClickBaseMapPath) {
|
||||
this.picClickBaseMapPath = picClickBaseMapPath;
|
||||
}
|
||||
|
||||
public String getFontType() {
|
||||
return fontType;
|
||||
}
|
||||
|
||||
public void setFontType(String fontType) {
|
||||
this.fontType = fontType;
|
||||
}
|
||||
|
||||
public Integer getHistoryDataClearEnable() {
|
||||
return historyDataClearEnable;
|
||||
}
|
||||
|
||||
public void setHistoryDataClearEnable(Integer historyDataClearEnable) {
|
||||
this.historyDataClearEnable = historyDataClearEnable;
|
||||
}
|
||||
|
||||
public Integer getReqFrequencyLimitEnable() {
|
||||
return reqFrequencyLimitEnable;
|
||||
}
|
||||
|
||||
public void setReqFrequencyLimitEnable(Integer reqFrequencyLimitEnable) {
|
||||
this.reqFrequencyLimitEnable = reqFrequencyLimitEnable;
|
||||
}
|
||||
|
||||
public int getReqGetLockLimit() {
|
||||
return reqGetLockLimit;
|
||||
}
|
||||
|
||||
public void setReqGetLockLimit(int reqGetLockLimit) {
|
||||
this.reqGetLockLimit = reqGetLockLimit;
|
||||
}
|
||||
|
||||
public int getReqGetLockSeconds() {
|
||||
return reqGetLockSeconds;
|
||||
}
|
||||
|
||||
public void setReqGetLockSeconds(int reqGetLockSeconds) {
|
||||
this.reqGetLockSeconds = reqGetLockSeconds;
|
||||
}
|
||||
|
||||
public int getReqGetMinuteLimit() {
|
||||
return reqGetMinuteLimit;
|
||||
}
|
||||
|
||||
public void setReqGetMinuteLimit(int reqGetMinuteLimit) {
|
||||
this.reqGetMinuteLimit = reqGetMinuteLimit;
|
||||
}
|
||||
|
||||
public int getReqCheckMinuteLimit() {
|
||||
return reqCheckMinuteLimit;
|
||||
}
|
||||
|
||||
public void setReqCheckMinuteLimit(int reqCheckMinuteLimit) {
|
||||
this.reqCheckMinuteLimit = reqCheckMinuteLimit;
|
||||
}
|
||||
|
||||
public int getReqVerifyMinuteLimit() {
|
||||
return reqVerifyMinuteLimit;
|
||||
}
|
||||
|
||||
public void setReqVerifyMinuteLimit(int reqVerifyMinuteLimit) {
|
||||
this.reqVerifyMinuteLimit = reqVerifyMinuteLimit;
|
||||
}
|
||||
|
||||
public String getCacheNumber() {
|
||||
return cacheNumber;
|
||||
}
|
||||
|
||||
public void setCacheNumber(String cacheNumber) {
|
||||
this.cacheNumber = cacheNumber;
|
||||
}
|
||||
|
||||
public String getTimingClear() {
|
||||
return timingClear;
|
||||
}
|
||||
|
||||
public void setTimingClear(String timingClear) {
|
||||
this.timingClear = timingClear;
|
||||
}
|
||||
|
||||
public String getWaterMark() {
|
||||
return waterMark;
|
||||
}
|
||||
|
||||
public void setWaterMark(String waterMark) {
|
||||
this.waterMark = waterMark;
|
||||
}
|
||||
|
||||
public String getWaterFont() {
|
||||
return waterFont;
|
||||
}
|
||||
|
||||
public void setWaterFont(String waterFont) {
|
||||
this.waterFont = waterFont;
|
||||
}
|
||||
|
||||
public String getInterferenceOptions() {
|
||||
return interferenceOptions;
|
||||
}
|
||||
|
||||
public void setInterferenceOptions(String interferenceOptions) {
|
||||
this.interferenceOptions = interferenceOptions;
|
||||
}
|
||||
|
||||
public int getFontStyle() {
|
||||
return fontStyle;
|
||||
}
|
||||
|
||||
public void setFontStyle(int fontStyle) {
|
||||
this.fontStyle = fontStyle;
|
||||
}
|
||||
|
||||
public int getFontSize() {
|
||||
return fontSize;
|
||||
}
|
||||
|
||||
public void setFontSize(int fontSize) {
|
||||
this.fontSize = fontSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BehaviorCaptchaProperties{" + "enabled=" + enabled + ", enableAes=" + enableAes + ", type=" + type + ", cacheType=" + cacheType + ", cacheImpl=" + cacheImpl + ", jigsawBaseMapPath='" + jigsawBaseMapPath + '\'' + ", slipOffset='" + slipOffset + '\'' + ", picClickBaseMapPath='" + picClickBaseMapPath + '\'' + ", fontType='" + fontType + '\'' + ", historyDataClearEnable=" + historyDataClearEnable + ", reqFrequencyLimitEnable=" + reqFrequencyLimitEnable + ", reqGetLockLimit=" + reqGetLockLimit + ", reqGetLockSeconds=" + reqGetLockSeconds + ", reqGetMinuteLimit=" + reqGetMinuteLimit + ", reqCheckMinuteLimit=" + reqCheckMinuteLimit + ", reqVerifyMinuteLimit=" + reqVerifyMinuteLimit + ", cacheNumber='" + cacheNumber + '\'' + ", timingClear='" + timingClear + '\'' + ", waterMark='" + waterMark + '\'' + ", waterFont='" + waterFont + '\'' + ", interferenceOptions='" + interferenceOptions + '\'' + ", fontStyle=" + fontStyle + ", fontSize=" + fontSize + '}';
|
||||
}
|
||||
}
|
||||
|
@@ -16,15 +16,12 @@
|
||||
|
||||
package top.charles7c.continew.starter.captcha.behavior.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 缓存类型枚举
|
||||
*
|
||||
* @author Bull-BCLS
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Getter
|
||||
public enum StorageType {
|
||||
|
||||
/**
|
||||
|
@@ -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