commit 7180e3dcc03c32eac99f4b3b08b1d26aab6e3e13 Author: 白茶清欢 Date: Mon Jun 2 05:10:04 2025 +0800 初始化项目 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