@Deprecated public class ResultInfo extends Object
RESTful
风格API结果Constructor and Description |
---|
ResultInfo()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static Result<?> |
attack()
Deprecated.
非法访问-402
|
static <T> Result<T> |
attack(T data)
Deprecated.
非法访问-402
|
static Result<?> |
clientFallback()
Deprecated.
哎哟喂!网络开小差了,请稍后重试...-507
|
static Result<?> |
clientFallbackError()
Deprecated.
哎哟喂!服务都被您挤爆了...-508
|
static Result<?> |
dataStructure()
Deprecated.
数据结构异常-505
|
static Result<?> |
dataStructure(int expected,
int actual)
Deprecated.
数据结构异常-505
|
static Result<?> |
dbError()
Deprecated.
数据结构异常,请检查相应数据结构一致性-506
|
static Result<String> |
dbError(String data)
Deprecated.
数据结构异常,请检查相应数据结构一致性-506
|
static Result<?> |
devCustomTypePrompt(String msg)
Deprecated.
开发者自定义类型提示-600
|
static <T> Result<?> |
devCustomTypePrompt(String msg,
T data)
Deprecated.
开发者自定义类型提示-600
|
static Result<?> |
error()
Deprecated.
请求错误-501
|
static <T> Result<T> |
error(T data)
Deprecated.
请求错误-501
|
static Result<?> |
fileEmpty()
Deprecated.
文件上传请求错误,获得文件信息为空,同时文件必须有明确的匹配类型(如文本类型:.txt)-301
|
static Result<?> |
forbidden()
Deprecated.
无权限-403
|
static Result<?> |
gone()
Deprecated.
API接口版本弃用-410
|
static Result<?> |
internalServerError()
Deprecated.
服务器内部错误-500
|
static <T> Result<T> |
internalServerError(T data)
Deprecated.
服务器内部错误-500
|
static Result<?> |
loggedIn()
Deprecated.
会话未注销,无需登录-210
|
static Result<?> |
paramCheckNotPass()
Deprecated.
参数校验未通过,请参照API核对后重试-433
|
static Result<String> |
paramCheckNotPass(String data)
Deprecated.
参数校验未通过,请参照API核对后重试-433
|
static Result<?> |
paramDecryptError()
Deprecated.
参数解密错误-435
|
static Result<?> |
paramValueInvalid()
Deprecated.
参数校验未通过,无效的value-434
|
static Result<String> |
paramValueInvalid(String data)
Deprecated.
参数校验未通过,无效的value-434
|
static Result<?> |
paramVoid()
Deprecated.
参数为空-432
|
static Result<?> |
resourceAlreadyInvalid()
Deprecated.
资源已失效-300
|
static Result<?> |
success()
Deprecated.
成功后调用,返回的data为null
|
static <T> Result<T> |
success(Integer code,
Long count,
T data)
Deprecated.
成功后调用,分页查询
|
static <T> Result<T> |
success(Long count,
T data)
Deprecated.
成功后调用,分页查询
|
static <T> Result<T> |
success(T data)
Deprecated.
成功后调用,返回的data为一个对象
|
static Result<?> |
tooManyRequests()
Deprecated.
频繁请求限流-429
|
static Result<String> |
typeConvertError(String data)
Deprecated.
类型转换错误-509
|
static Result<?> |
unauthorized()
Deprecated.
未登录或登录已失效-401
|
public static Result<?> success()
public static <T> Result<T> success(T data)
T
- 泛型data
- 数据public static <T> Result<T> success(Long count, T data)
T
- 泛型count
- 总数data
- 数据public static <T> Result<T> success(Integer code, Long count, T data)
T
- 泛型code
- 自定义code(默认200)count
- 总数data
- 数据public static Result<?> loggedIn()
public static Result<?> resourceAlreadyInvalid()
public static Result<?> fileEmpty()
public static Result<?> unauthorized()
public static Result<?> attack()
public static <T> Result<T> attack(T data)
T
- 泛型data
- 异常数据public static Result<?> forbidden()
public static Result<?> gone()
public static Result<?> tooManyRequests()
public static Result<?> paramVoid()
public static Result<?> paramCheckNotPass()
public static Result<String> paramCheckNotPass(String data)
data
- Result#setData(Object)
提示信息public static Result<?> paramValueInvalid()
public static Result<String> paramValueInvalid(String data)
data
- Result#setData(Object)
提示信息public static Result<?> paramDecryptError()
public static Result<?> internalServerError()
public static <T> Result<T> internalServerError(T data)
T
- 泛型data
- 异常数据public static Result<?> error()
public static <T> Result<T> error(T data)
T
- 泛型data
- 异常数据public static Result<?> dataStructure()
public static Result<?> dataStructure(int expected, int actual)
不正确的结果大小
expected
- 预期值actual
- 实际值public static Result<?> dbError()
public static Result<String> dbError(String data)
data
- Result#setData(Object)
提示信息public static Result<?> clientFallback()
public static Result<?> clientFallbackError()
public static Result<String> typeConvertError(String data)
data
- Result#setData(Object)
提示信息public static Result<?> devCustomTypePrompt(String msg)
请覆盖:Result#setMsg(String)
用于业务消息提示,如:、
msg
- 提示消息Copyright © 2022 Pivotal Software, Inc.. All rights reserved.