update 优化 删除无用异常类

2.X
疯狂的狮子Li 1 year ago
parent b88e26b33b
commit 1944cca859

@ -19,7 +19,7 @@ import org.dromara.common.core.constant.TenantConstants;
import org.dromara.common.core.enums.LoginType; import org.dromara.common.core.enums.LoginType;
import org.dromara.common.core.enums.TenantStatus; import org.dromara.common.core.enums.TenantStatus;
import org.dromara.common.core.enums.UserType; import org.dromara.common.core.enums.UserType;
import org.dromara.common.core.exception.CaptchaException; import org.dromara.common.core.exception.user.CaptchaException;
import org.dromara.common.core.exception.user.CaptchaExpireException; import org.dromara.common.core.exception.user.CaptchaExpireException;
import org.dromara.common.core.exception.user.UserException; import org.dromara.common.core.exception.user.UserException;
import org.dromara.common.core.utils.MessageUtils; import org.dromara.common.core.utils.MessageUtils;

@ -14,7 +14,7 @@ import org.dromara.auth.service.SysLoginService;
import org.dromara.common.core.constant.Constants; import org.dromara.common.core.constant.Constants;
import org.dromara.common.core.constant.GlobalConstants; import org.dromara.common.core.constant.GlobalConstants;
import org.dromara.common.core.enums.LoginType; import org.dromara.common.core.enums.LoginType;
import org.dromara.common.core.exception.CaptchaException; import org.dromara.common.core.exception.user.CaptchaException;
import org.dromara.common.core.exception.user.CaptchaExpireException; import org.dromara.common.core.exception.user.CaptchaExpireException;
import org.dromara.common.core.utils.MessageUtils; import org.dromara.common.core.utils.MessageUtils;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;

@ -1,29 +0,0 @@
package org.dromara.common.core.exception;
import java.io.Serial;
/**
*
*
* @author ruoyi
*/
public class CheckedException extends RuntimeException {
@Serial
private static final long serialVersionUID = 1L;
public CheckedException(String message) {
super(message);
}
public CheckedException(Throwable cause) {
super(cause);
}
public CheckedException(String message, Throwable cause) {
super(message, cause);
}
public CheckedException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}

@ -1,17 +0,0 @@
package org.dromara.common.core.exception;
import java.io.Serial;
/**
*
*
* @author ruoyi
*/
public class DemoModeException extends RuntimeException {
@Serial
private static final long serialVersionUID = 1L;
public DemoModeException() {
}
}

@ -1,56 +0,0 @@
package org.dromara.common.core.exception;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.io.Serial;
/**
*
*
* @author ruoyi
*/
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class GlobalException extends RuntimeException {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
private String message;
/**
*
*/
private String detailMessage;
public GlobalException(String message) {
this.message = message;
}
public String getDetailMessage() {
return detailMessage;
}
public GlobalException setDetailMessage(String detailMessage) {
this.detailMessage = detailMessage;
return this;
}
@Override
public String getMessage() {
return message;
}
public GlobalException setMessage(String message) {
this.message = message;
return this;
}
}

@ -1,26 +0,0 @@
package org.dromara.common.core.exception;
import java.io.Serial;
/**
*
*
* @author ruoyi
*/
public class UtilException extends RuntimeException {
@Serial
private static final long serialVersionUID = 8247610319171014183L;
public UtilException(Throwable e) {
super(e.getMessage(), e);
}
public UtilException(String message) {
super(message);
}
public UtilException(String message, Throwable throwable) {
super(message, throwable);
}
}

@ -1,6 +1,4 @@
package org.dromara.common.core.exception; package org.dromara.common.core.exception.user;
import org.dromara.common.core.exception.user.UserException;
import java.io.Serial; import java.io.Serial;

@ -1,18 +0,0 @@
package org.dromara.common.core.exception.user;
import java.io.Serial;
/**
*
*
* @author ruoyi
*/
public class UserPasswordNotMatchException extends UserException {
@Serial
private static final long serialVersionUID = 1L;
public UserPasswordNotMatchException() {
super("user.password.not.match");
}
}

@ -1,9 +1,8 @@
package org.dromara.common.core.utils.sql; package org.dromara.common.core.utils.sql;
import org.dromara.common.core.exception.UtilException;
import org.dromara.common.core.utils.StringUtils;
import lombok.AccessLevel; import lombok.AccessLevel;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.dromara.common.core.utils.StringUtils;
/** /**
* sql * sql
@ -28,7 +27,7 @@ public class SqlUtil {
*/ */
public static String escapeOrderBySql(String value) { public static String escapeOrderBySql(String value) {
if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) { if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) {
throw new UtilException("参数不符合规范,不能进行查询"); throw new IllegalArgumentException("参数不符合规范,不能进行查询");
} }
return value; return value;
} }
@ -50,7 +49,7 @@ public class SqlUtil {
String[] sqlKeywords = StringUtils.split(SQL_REGEX, "\\|"); String[] sqlKeywords = StringUtils.split(SQL_REGEX, "\\|");
for (String sqlKeyword : sqlKeywords) { for (String sqlKeyword : sqlKeywords) {
if (StringUtils.indexOfIgnoreCase(value, sqlKeyword) > -1) { if (StringUtils.indexOfIgnoreCase(value, sqlKeyword) > -1) {
throw new UtilException("参数存在SQL注入风险"); throw new IllegalArgumentException("参数存在SQL注入风险");
} }
} }
} }

Loading…
Cancel
Save