public enum ResultEnum extends Enum<ResultEnum>
参考HttpStatus
Enum Constant and Description |
---|
ATTACK |
BAD_GATEWAY |
BAD_REQUEST
HttpStatus.BAD_REQUEST |
CLIENT_FALLBACK |
CLIENT_FALLBACK_ERROR |
DATA_STRUCTURE |
DB_ERROR |
DEV_CUSTOM_TYPE_PROMPT
Deprecated.
请使用
ERROR_PROMPT |
ERROR
Deprecated.
此错误响应容易引起纠纷争议,特此废弃。可使用
REQUEST_ERROR 代替 |
ERROR_PROMPT
错误提示,请使用具体的错误提示信息覆盖此
msg |
FILE_EMPTY |
FORBIDDEN |
GATEWAY_TIMEOUT
HttpStatus.GATEWAY_TIMEOUT |
GONE
HttpStatus.GONE |
INTERNAL_SERVER_ERROR
HttpStatus.INTERNAL_SERVER_ERROR |
LOGGED_IN |
METHOD_NOT_ALLOWED
HttpStatus.METHOD_NOT_ALLOWED |
MOVED_PERMANENTLY
HttpStatus.MOVED_PERMANENTLY |
NOT_FOUND
HttpStatus.NOT_FOUND |
PARAM_CHECK_NOT_PASS |
PARAM_DECRYPT_ERROR |
PARAM_VALUE_INVALID |
PARAM_VOID |
REQUEST_ERROR |
RESOURCE_ALREADY_INVALID |
SERVICE_UNAVAILABLE
HttpStatus.SERVICE_UNAVAILABLE |
SUCCESS
HttpStatus.OK |
TOO_MANY_REQUESTS
HttpStatus.TOO_MANY_REQUESTS |
TYPE_CONVERT_ERROR |
UNAUTHORIZED |
UNSUPPORTED_MEDIA_TYPE |
Modifier and Type | Method and Description |
---|---|
static ResultEnum |
valueOf(int code)
如果可能,将给定的状态代码解析为
ResultEnum |
static ResultEnum |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ResultEnum[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ResultEnum SUCCESS
HttpStatus.OK
200 OK
.
public static final ResultEnum LOGGED_IN
public static final ResultEnum RESOURCE_ALREADY_INVALID
public static final ResultEnum MOVED_PERMANENTLY
HttpStatus.MOVED_PERMANENTLY
301 Moved Permanently
.
public static final ResultEnum FILE_EMPTY
public static final ResultEnum BAD_REQUEST
HttpStatus.BAD_REQUEST
400 Bad Request
.
public static final ResultEnum UNAUTHORIZED
public static final ResultEnum ATTACK
public static final ResultEnum FORBIDDEN
public static final ResultEnum NOT_FOUND
HttpStatus.NOT_FOUND
404 Not Found
.
public static final ResultEnum METHOD_NOT_ALLOWED
HttpStatus.METHOD_NOT_ALLOWED
405 Method Not Allowed
.
public static final ResultEnum GONE
HttpStatus.GONE
410 Gone
.
public static final ResultEnum UNSUPPORTED_MEDIA_TYPE
public static final ResultEnum TOO_MANY_REQUESTS
HttpStatus.TOO_MANY_REQUESTS
429 Too Many Requests
.
public static final ResultEnum PARAM_VOID
public static final ResultEnum PARAM_CHECK_NOT_PASS
public static final ResultEnum PARAM_VALUE_INVALID
public static final ResultEnum PARAM_DECRYPT_ERROR
public static final ResultEnum INTERNAL_SERVER_ERROR
HttpStatus.INTERNAL_SERVER_ERROR
500 Internal Server Error
.
public static final ResultEnum REQUEST_ERROR
@Deprecated public static final ResultEnum ERROR
REQUEST_ERROR
代替public static final ResultEnum BAD_GATEWAY
public static final ResultEnum SERVICE_UNAVAILABLE
HttpStatus.SERVICE_UNAVAILABLE
503 Service Unavailable
.
public static final ResultEnum GATEWAY_TIMEOUT
HttpStatus.GATEWAY_TIMEOUT
504 Gateway Timeout
.
public static final ResultEnum DATA_STRUCTURE
public static final ResultEnum DB_ERROR
public static final ResultEnum CLIENT_FALLBACK
public static final ResultEnum CLIENT_FALLBACK_ERROR
public static final ResultEnum TYPE_CONVERT_ERROR
public static final ResultEnum ERROR_PROMPT
msg
@Deprecated public static final ResultEnum DEV_CUSTOM_TYPE_PROMPT
ERROR_PROMPT
public static ResultEnum[] values()
for (ResultEnum c : ResultEnum.values()) System.out.println(c);
public static ResultEnum valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null@Nullable public static ResultEnum valueOf(int code)
ResultEnum
code
- HTTP状态码(可能是非标准的)ResultEnum
,如果没有找到,则为 null
Copyright © 2022 Pivotal Software, Inc.. All rights reserved.