chore: 移除 lombok 依赖

再度精简依赖
This commit is contained in:
jasmine
2024-01-31 06:02:17 +00:00
committed by Charles7c
parent e1b7fea24f
commit 0eb6afabb6
70 changed files with 1437 additions and 190 deletions

View File

@@ -19,7 +19,8 @@ package top.charles7c.continew.starter.core.autoconfigure.password;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
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;
@@ -49,11 +50,11 @@ import java.util.Map;
* @author Jasmine
* @since 1.3.0
*/
@Slf4j
@AutoConfiguration
@EnableConfigurationProperties(PasswordEncoderProperties.class)
@ConditionalOnProperty(prefix = PropertiesConstants.PASSWORD_ENCODER, name = PropertiesConstants.ENABLED, havingValue = "true")
public class PasswordEncoderAutoConfiguration {
private static final Logger log = LoggerFactory.getLogger(PasswordEncoderAutoConfiguration.class);
private final PasswordEncoderProperties properties;

View File

@@ -16,7 +16,6 @@
package top.charles7c.continew.starter.core.autoconfigure.password;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
@@ -26,7 +25,6 @@ import top.charles7c.continew.starter.core.constant.PropertiesConstants;
* @author Jasmine
* @since 1.3.0
*/
@Data
@ConfigurationProperties(PropertiesConstants.PASSWORD_ENCODER)
public class PasswordEncoderProperties {
@@ -39,4 +37,25 @@ public class PasswordEncoderProperties {
* 启用的算法 ID
*/
private String encodingId;
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public String getEncodingId() {
return encodingId;
}
public void setEncodingId(String encodingId) {
this.encodingId = encodingId;
}
@Override
public String toString() {
return "PasswordEncoderProperties{" + "enabled=" + enabled + ", encodingId='" + encodingId + '\'' + '}';
}
}

View File

@@ -16,7 +16,6 @@
package top.charles7c.continew.starter.core.autoconfigure.project;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
@@ -28,7 +27,6 @@ import org.springframework.context.annotation.Import;
* @author Charles7c
* @since 1.0.0
*/
@Slf4j
@AutoConfiguration
@ComponentScan("cn.hutool.extra.spring")
@Import(cn.hutool.extra.spring.SpringUtil.class)

View File

@@ -16,7 +16,6 @@
package top.charles7c.continew.starter.core.autoconfigure.project;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
@@ -25,7 +24,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @author Charles7c
* @since 1.0.0
*/
@Data
@ConfigurationProperties(prefix = "project")
public class ProjectProperties {
@@ -77,7 +75,6 @@ public class ProjectProperties {
/**
* 联系人配置属性
*/
@Data
public static class Contact {
/**
* 名称
@@ -93,12 +90,40 @@ public class ProjectProperties {
* URL
*/
private String url;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
@Override
public String toString() {
return "Contact{" + "name='" + name + '\'' + ", email='" + email + '\'' + ", url='" + url + '\'' + '}';
}
}
/**
* 许可协议配置属性
*/
@Data
public static class License {
/**
* 名称
@@ -109,5 +134,103 @@ public class ProjectProperties {
* URL
*/
private String url;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
@Override
public String toString() {
return "License{" + "name='" + name + '\'' + ", url='" + url + '\'' + '}';
}
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getBasePackage() {
return basePackage;
}
public void setBasePackage(String basePackage) {
this.basePackage = basePackage;
}
public Contact getContact() {
return contact;
}
public void setContact(Contact contact) {
this.contact = contact;
}
public License getLicense() {
return license;
}
public void setLicense(License license) {
this.license = license;
}
public boolean isProduction() {
return production;
}
public void setProduction(boolean production) {
this.production = production;
}
@Override
public String toString() {
return "ProjectProperties{" + "name='" + name + '\'' + ", appName='" + appName + '\'' + ", version='" + version + '\'' + ", description='" + description + '\'' + ", url='" + url + '\'' + ", basePackage='" + basePackage + '\'' + ", contact=" + contact + ", license=" + license + ", production=" + production + '}';
}
}

View File

@@ -17,8 +17,8 @@
package top.charles7c.continew.starter.core.autoconfigure.threadpool;
import cn.hutool.core.util.ArrayUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -39,16 +39,19 @@ import java.util.concurrent.ScheduledExecutorService;
* @author Lion Li<a href="https://gitee.com/dromara/RuoYi-Vue-Plus">RuoYi-Vue-Plus</a>
* @since 1.0.0
*/
@Slf4j
@Lazy
@AutoConfiguration
@RequiredArgsConstructor
@EnableAsync(proxyTargetClass = true)
@ConditionalOnProperty(prefix = PropertiesConstants.THREAD_POOL, name = PropertiesConstants.ENABLED, havingValue = "true")
public class AsyncAutoConfiguration implements AsyncConfigurer {
private static final Logger log = LoggerFactory.getLogger(AsyncAutoConfiguration.class);
private final ScheduledExecutorService scheduledExecutorService;
public AsyncAutoConfiguration(ScheduledExecutorService scheduledExecutorService) {
this.scheduledExecutorService = scheduledExecutorService;
}
/**
* 异步任务 @Async 执行时,使用 Java 内置线程池
*/

View File

@@ -18,7 +18,8 @@ package top.charles7c.continew.starter.core.autoconfigure.threadpool;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.ObjectUtil;
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;
@@ -40,12 +41,12 @@ import java.util.concurrent.ThreadPoolExecutor;
* @author Lion Li<a href="https://gitee.com/dromara/RuoYi-Vue-Plus">RuoYi-Vue-Plus</a>
* @since 1.0.0
*/
@Slf4j
@Lazy
@AutoConfiguration
@ConditionalOnProperty(prefix = PropertiesConstants.THREAD_POOL, name = PropertiesConstants.ENABLED, havingValue = "true")
@EnableConfigurationProperties(ThreadPoolProperties.class)
public class ThreadPoolAutoConfiguration {
private static final Logger log = LoggerFactory.getLogger(ThreadPoolAutoConfiguration.class);
/**
* 核心(最小)线程数 = CPU 核心数 + 1

View File

@@ -16,7 +16,6 @@
package top.charles7c.continew.starter.core.autoconfigure.threadpool;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import top.charles7c.continew.starter.core.constant.PropertiesConstants;
@@ -27,7 +26,6 @@ import top.charles7c.continew.starter.core.constant.PropertiesConstants;
* @author Lion Li<a href="https://gitee.com/dromara/RuoYi-Vue-Plus">RuoYi-Vue-Plus</a>
* @since 1.0.0
*/
@Data
@ConfigurationProperties(PropertiesConstants.THREAD_POOL)
public class ThreadPoolProperties {
@@ -55,4 +53,49 @@ public class ThreadPoolProperties {
* 活跃时间(单位:秒)
*/
private int keepAliveSeconds = 300;
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public Integer getCorePoolSize() {
return corePoolSize;
}
public void setCorePoolSize(Integer corePoolSize) {
this.corePoolSize = corePoolSize;
}
public Integer getMaxPoolSize() {
return maxPoolSize;
}
public void setMaxPoolSize(Integer maxPoolSize) {
this.maxPoolSize = maxPoolSize;
}
public int getQueueCapacity() {
return queueCapacity;
}
public void setQueueCapacity(int queueCapacity) {
this.queueCapacity = queueCapacity;
}
public int getKeepAliveSeconds() {
return keepAliveSeconds;
}
public void setKeepAliveSeconds(int keepAliveSeconds) {
this.keepAliveSeconds = keepAliveSeconds;
}
@Override
public String toString() {
return "ThreadPoolProperties{" + "enabled=" + enabled + ", corePoolSize=" + corePoolSize + ", maxPoolSize=" + maxPoolSize + ", queueCapacity=" + queueCapacity + ", keepAliveSeconds=" + keepAliveSeconds + '}';
}
}

View File

@@ -16,7 +16,8 @@
package top.charles7c.continew.starter.core.util;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import top.charles7c.continew.starter.core.constant.StringConstants;
import java.util.concurrent.CancellationException;
@@ -30,8 +31,8 @@ import java.util.function.Consumer;
* @author Charles7c
* @since 1.0.0
*/
@Slf4j
public class ExceptionUtils {
private static final Logger log = LoggerFactory.getLogger(ExceptionUtils.class);
private ExceptionUtils() {
}

View File

@@ -21,7 +21,6 @@ import cn.hutool.core.net.NetUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.spring.SpringUtil;
import cn.hutool.http.HtmlUtil;
import lombok.extern.slf4j.Slf4j;
import net.dreamlu.mica.ip2region.core.Ip2regionSearcher;
import net.dreamlu.mica.ip2region.core.IpInfo;
import top.charles7c.continew.starter.core.constant.StringConstants;
@@ -34,7 +33,6 @@ import java.util.Set;
* @author Charles7c
* @since 1.0.0
*/
@Slf4j
public class IpUtils {
private IpUtils() {

View File

@@ -16,9 +16,6 @@
package top.charles7c.continew.starter.core.util.db;
import lombok.Getter;
import lombok.Setter;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
@@ -29,8 +26,6 @@ import java.time.LocalDateTime;
* @author Charles7c
* @since 1.0.0
*/
@Getter
@Setter
public class Table implements Serializable {
@Serial
@@ -69,4 +64,57 @@ public class Table implements Serializable {
public Table(String tableName) {
this.tableName = tableName;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public String getEngine() {
return engine;
}
public void setEngine(String engine) {
this.engine = engine;
}
public String getCharset() {
return charset;
}
public void setCharset(String charset) {
this.charset = charset;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
public LocalDateTime getUpdateTime() {
return updateTime;
}
public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime;
}
@Override
public String toString() {
return "Table{" + "tableName='" + tableName + '\'' + ", comment='" + comment + '\'' + ", engine='" + engine + '\'' + ", charset='" + charset + '\'' + ", createTime=" + createTime + ", updateTime=" + updateTime + '}';
}
}

View File

@@ -17,7 +17,6 @@
package top.charles7c.continew.starter.core.util.validate;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import top.charles7c.continew.starter.core.constant.StringConstants;
import top.charles7c.continew.starter.core.exception.BusinessException;
@@ -30,7 +29,6 @@ import java.util.function.BooleanSupplier;
* @see BusinessException
* @since 1.0.0
*/
@Slf4j
public class CheckUtils extends Validator {
private static final Class<BusinessException> EXCEPTION_TYPE = BusinessException.class;

View File

@@ -17,7 +17,6 @@
package top.charles7c.continew.starter.core.util.validate;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import top.charles7c.continew.starter.core.exception.BadRequestException;
import java.util.function.BooleanSupplier;
@@ -29,7 +28,6 @@ import java.util.function.BooleanSupplier;
* @see BadRequestException
* @since 1.0.0
*/
@Slf4j
public class ValidationUtils extends Validator {
private static final Class<BadRequestException> EXCEPTION_TYPE = BadRequestException.class;

View File

@@ -19,7 +19,8 @@ package top.charles7c.continew.starter.core.util.validate;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.function.BooleanSupplier;
@@ -29,8 +30,8 @@ import java.util.function.BooleanSupplier;
* @author Charles7c
* @since 1.0.0
*/
@Slf4j
public class Validator {
private static final Logger log = LoggerFactory.getLogger(Validator.class);
protected Validator() {
}