From d42585cb4d6660724db004893f57a6c67b4690e1 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Mon, 19 Feb 2024 20:24:03 +0800 Subject: [PATCH] =?UTF-8?q?refactor(core):=20=E5=AE=8C=E5=96=84=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=BC=82=E5=B8=B8=E7=B1=BB=E6=9E=84=E9=80=A0?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../starter/core/exception/BadRequestException.java | 13 +++++++++++++ .../starter/core/exception/BaseException.java | 13 +++++++++++++ .../starter/core/exception/BusinessException.java | 13 +++++++++++++ 3 files changed, 39 insertions(+) diff --git a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BadRequestException.java b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BadRequestException.java index 95f6afd3..280e5f0b 100644 --- a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BadRequestException.java +++ b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BadRequestException.java @@ -16,6 +16,8 @@ package top.charles7c.continew.starter.core.exception; +import java.io.Serial; + /** * 自定义验证异常-错误请求 * @@ -24,10 +26,21 @@ package top.charles7c.continew.starter.core.exception; */ public class BadRequestException extends BaseException { + @Serial + private static final long serialVersionUID = 1L; + public BadRequestException() { } public BadRequestException(String message) { super(message); } + + public BadRequestException(Throwable cause) { + super(cause); + } + + public BadRequestException(String message, Throwable cause) { + super(message, cause); + } } diff --git a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BaseException.java b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BaseException.java index e1058073..efd069e1 100644 --- a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BaseException.java +++ b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BaseException.java @@ -16,6 +16,8 @@ package top.charles7c.continew.starter.core.exception; +import java.io.Serial; + /** * 自定义异常基类 * @@ -24,10 +26,21 @@ package top.charles7c.continew.starter.core.exception; */ public class BaseException extends RuntimeException { + @Serial + private static final long serialVersionUID = 1L; + public BaseException() { } public BaseException(String message) { super(message); } + + public BaseException(Throwable cause) { + super(cause); + } + + public BaseException(String message, Throwable cause) { + super(message, cause); + } } diff --git a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BusinessException.java b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BusinessException.java index 4f71a194..73f6b1f5 100644 --- a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BusinessException.java +++ b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BusinessException.java @@ -16,6 +16,8 @@ package top.charles7c.continew.starter.core.exception; +import java.io.Serial; + /** * 业务异常 * @@ -24,10 +26,21 @@ package top.charles7c.continew.starter.core.exception; */ public class BusinessException extends BaseException { + @Serial + private static final long serialVersionUID = 1L; + public BusinessException() { } public BusinessException(String message) { super(message); } + + public BusinessException(Throwable cause) { + super(cause); + } + + public BusinessException(String message, Throwable cause) { + super(message, cause); + } }