From 69a76be328835c8fd828e18e66904aa82c1eec87 Mon Sep 17 00:00:00 2001 From: p5j9vn3t2 <2596686495@qq.com> Date: Sun, 30 Apr 2023 08:08:25 +0800 Subject: [PATCH] ADD file via upload --- .../java/com/exception/CustomException.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/main/java/com/exception/CustomException.java diff --git a/src/main/java/com/exception/CustomException.java b/src/main/java/com/exception/CustomException.java new file mode 100644 index 0000000..b9441e5 --- /dev/null +++ b/src/main/java/com/exception/CustomException.java @@ -0,0 +1,35 @@ +package com.example.exception; + +import com.example.common.ResultCode; + +public class CustomException extends RuntimeException { + private String code; + private String msg; + + public CustomException(ResultCode resultCode) { + this.code = resultCode.code; + this.msg = resultCode.msg; + } + + public CustomException(String code, String msg) { + this.code = code; + this.msg = msg; + } + + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } +}