| | |
| | | |
| | | // 未登录 |
| | | UNAUTHORIZED(401, "未登录"), |
| | | // 未知异常 |
| | | BAD_EXCEPTION(10000, "系统异常"), |
| | | // 成功 |
| | | SUCCESS(200, "成功"); |
| | |
| | | |
| | | 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); |