From 7180e3dcc03c32eac99f4b3b08b1d26aab6e3e13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Mon, 2 Jun 2025 05:10:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 30 ++++++++++++++++++++++ pom.xml | 17 ++++++++++++ src/main/java/cn/zhangdeman/Exception.java | 19 ++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 src/main/java/cn/zhangdeman/Exception.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c9a900d --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# Created by .ignore support plugin (hsz.mobi) +### Go template +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ +.idea +.mvn +.vscode +.fleet +release +logs +.scannerwork +.env +__debug* +target +gateway.iml +gateway.ipr +gateway.iws \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..05a8106 --- /dev/null +++ b/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + cn.zhangdeman + exception + 1.0-SNAPSHOT + + + 21 + 21 + UTF-8 + + + \ No newline at end of file diff --git a/src/main/java/cn/zhangdeman/Exception.java b/src/main/java/cn/zhangdeman/Exception.java new file mode 100644 index 0000000..801ccd4 --- /dev/null +++ b/src/main/java/cn/zhangdeman/Exception.java @@ -0,0 +1,19 @@ +package cn.zhangdeman; + +// 自定义异常 +public class Exception { + private final Object code; // 错误码 + private final String message; // 异常信息 + private final Object data; // 异常数据 + + public Exception(Object code, Object data) { + this.code = code; + this.message = ""; // TODO : 根据code初始化Message + this.data = data; + } + public Exception(Object code, String message, Object data) { + this.code = code; + this.message = message; + this.data = data; + } +} \ No newline at end of file