初始化项目
This commit is contained in:
commit
7180e3dcc0
30
.gitignore
vendored
Normal file
30
.gitignore
vendored
Normal file
@ -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
|
17
pom.xml
Normal file
17
pom.xml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>cn.zhangdeman</groupId>
|
||||||
|
<artifactId>exception</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
19
src/main/java/cn/zhangdeman/Exception.java
Normal file
19
src/main/java/cn/zhangdeman/Exception.java
Normal file
@ -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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user