From f227e6ac3439116a0f8cc185bce053e19bd65307 Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期三, 28 十二月 2022 11:50:16 +0800
Subject: [PATCH] fix: 优化code
---
src/main/java/com/example/jz/enums/BusinessHttpStatus.java | 18 +++++-------------
1 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/src/main/java/com/example/jz/enums/BusinessHttpStatus.java b/src/main/java/com/example/jz/enums/BusinessHttpStatus.java
index acb2208..5578fbc 100644
--- a/src/main/java/com/example/jz/enums/BusinessHttpStatus.java
+++ b/src/main/java/com/example/jz/enums/BusinessHttpStatus.java
@@ -3,41 +3,33 @@
public enum BusinessHttpStatus {
// 鏈櫥褰�
- UNAUTHORIZED(401, "鏈巿鏉�");
+ UNAUTHORIZED(401, "鏈櫥褰�"),
+ // 鏈煡寮傚父
+ BAD_EXCEPTION(10000, "绯荤粺寮傚父"),
+ // 鎴愬姛
+ SUCCESS(200, "鎴愬姛");
private final int value;
private final String msg;
-
BusinessHttpStatus(int value, String msg) {
this.value = value;
this.msg = msg;
}
-
- /**
- * Return the integer value of this status code.
- */
public int value() {
return this.value;
}
- /**
- * Return the msg of this status code.
- */
public String getMsg() {
return msg;
}
- /**
- * Return a string representation of this status code.
- */
@Override
public String toString() {
return this.value + " " + name();
}
-
public static BusinessHttpStatus valueOf(int statusCode) {
BusinessHttpStatus status = resolve(statusCode);
--
Gitblit v1.8.0