mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-11 06:57:14 +08:00
refactor: 移除 Lombok 私有构造注解使用
修复 Sonarqube 扫描问题
This commit is contained in:
@@ -16,18 +16,17 @@
|
||||
|
||||
package top.charles7c.continew.starter.core.constant;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 配置属性相关常量
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 1.1.1
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class PropertiesConstants {
|
||||
|
||||
private PropertiesConstants() {
|
||||
}
|
||||
|
||||
/**
|
||||
* ContiNew Starter
|
||||
*/
|
||||
|
@@ -17,8 +17,6 @@
|
||||
package top.charles7c.continew.starter.core.constant;
|
||||
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 字符串相关常量
|
||||
@@ -26,9 +24,11 @@ import lombok.NoArgsConstructor;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class StringConstants implements StrPool {
|
||||
|
||||
private StringConstants() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 空字符串
|
||||
*/
|
||||
|
@@ -16,17 +16,17 @@
|
||||
|
||||
package top.charles7c.continew.starter.core.exception;
|
||||
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 自定义验证异常-错误请求
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
public class BadRequestException extends BaseException {
|
||||
|
||||
public BadRequestException() {
|
||||
}
|
||||
|
||||
public BadRequestException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
@@ -16,17 +16,17 @@
|
||||
|
||||
package top.charles7c.continew.starter.core.exception;
|
||||
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 自定义异常基类
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
public class BaseException extends RuntimeException {
|
||||
|
||||
public BaseException() {
|
||||
}
|
||||
|
||||
public BaseException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
@@ -16,17 +16,17 @@
|
||||
|
||||
package top.charles7c.continew.starter.core.exception;
|
||||
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 业务异常
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
public class BusinessException extends BaseException {
|
||||
|
||||
public BusinessException() {
|
||||
}
|
||||
|
||||
public BusinessException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
@@ -16,8 +16,6 @@
|
||||
|
||||
package top.charles7c.continew.starter.core.util;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
|
||||
@@ -33,9 +31,11 @@ import java.util.function.Consumer;
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class ExceptionUtils {
|
||||
|
||||
private ExceptionUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印线程异常信息
|
||||
*
|
||||
|
@@ -21,8 +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.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dreamlu.mica.ip2region.core.Ip2regionSearcher;
|
||||
import net.dreamlu.mica.ip2region.core.IpInfo;
|
||||
@@ -37,9 +35,11 @@ import java.util.Set;
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class IpUtils {
|
||||
|
||||
private IpUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询 IP 归属地(本地库解析)
|
||||
*
|
||||
|
@@ -17,8 +17,6 @@
|
||||
package top.charles7c.continew.starter.core.util;
|
||||
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
@@ -32,9 +30,11 @@ import java.util.stream.Collectors;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class ReflectUtils {
|
||||
|
||||
private ReflectUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得一个类中所有非静态字段名列表,包括其父类中的字段<br>
|
||||
* 如果子类与父类中存在同名字段,则这两个字段同时存在,子类字段在前,父类字段在后。
|
||||
|
@@ -20,8 +20,6 @@ import cn.hutool.extra.template.Template;
|
||||
import cn.hutool.extra.template.TemplateConfig;
|
||||
import cn.hutool.extra.template.TemplateEngine;
|
||||
import cn.hutool.extra.template.TemplateUtil;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -31,11 +29,13 @@ import java.util.Map;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class TemplateUtils {
|
||||
|
||||
private static final String DEFAULT_TEMPLATE_PARENT_PATH = "templates";
|
||||
|
||||
private TemplateUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染模板
|
||||
*
|
||||
|
@@ -17,8 +17,6 @@
|
||||
package top.charles7c.continew.starter.core.util;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* URL(Uniform Resource Locator)统一资源定位符相关工具类
|
||||
@@ -26,9 +24,11 @@ import lombok.NoArgsConstructor;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class URLUtils {
|
||||
|
||||
private URLUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供的 URL 是否为 HTTP URL(协议包括:"http","https")
|
||||
*
|
||||
|
@@ -22,8 +22,6 @@ import cn.hutool.db.Db;
|
||||
import cn.hutool.db.Entity;
|
||||
import cn.hutool.db.meta.Column;
|
||||
import cn.hutool.db.meta.MetaUtil;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.SQLException;
|
||||
@@ -37,9 +35,11 @@ import java.util.List;
|
||||
* @author Charles7c
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class MetaUtils {
|
||||
|
||||
private MetaUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有表信息
|
||||
*
|
||||
|
@@ -17,8 +17,6 @@
|
||||
package top.charles7c.continew.starter.core.util.validate;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import top.charles7c.continew.starter.core.constant.StringConstants;
|
||||
import top.charles7c.continew.starter.core.exception.BusinessException;
|
||||
@@ -33,11 +31,13 @@ import java.util.function.BooleanSupplier;
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class CheckUtils extends Validator {
|
||||
|
||||
private static final Class<BusinessException> EXCEPTION_TYPE = BusinessException.class;
|
||||
|
||||
private CheckUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果不存在,抛出异常
|
||||
*
|
||||
|
@@ -17,8 +17,6 @@
|
||||
package top.charles7c.continew.starter.core.util.validate;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import top.charles7c.continew.starter.core.exception.BadRequestException;
|
||||
|
||||
@@ -32,11 +30,13 @@ import java.util.function.BooleanSupplier;
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class ValidationUtils extends Validator {
|
||||
|
||||
private static final Class<BadRequestException> EXCEPTION_TYPE = BadRequestException.class;
|
||||
|
||||
private ValidationUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果为空,抛出异常
|
||||
*
|
||||
|
@@ -19,8 +19,6 @@ 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.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
@@ -32,9 +30,11 @@ import java.util.function.BooleanSupplier;
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
public class Validator {
|
||||
|
||||
protected Validator() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果为空,抛出异常
|
||||
*
|
||||
|
Reference in New Issue
Block a user