From ec6d43aa07ee0e8faf34498057ebcfbb446aa015 Mon Sep 17 00:00:00 2001 From: hjl <1657978663@qq.com> Date: 星期二, 16 七月 2024 09:21:51 +0800 Subject: [PATCH] feat: 代码重构 --- ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/GlobalException.java | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/GlobalException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/GlobalException.java index 278b195..3aedecf 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/GlobalException.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/GlobalException.java @@ -14,6 +14,11 @@ private String message; /** + * 错误码 + */ + private Integer code; + + /** * 错误明细,内部调试错误 * <p> * 和 {@link CommonResult#getDetailMessage()} 一致的设计 @@ -26,8 +31,17 @@ public GlobalException() { } + public GlobalException(Integer code) { + this.code = code; + } + public GlobalException(String message) { this.message = message; + } + + public GlobalException(String message, Integer code) { + this.message = message; + this.code = code; } public String getDetailMessage() { @@ -48,4 +62,12 @@ this.message = message; return this; } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } } \ No newline at end of file -- Gitblit v1.7.1