public class Response
extends java.lang.Object
构造器和说明 |
---|
Response() |
限定符和类型 | 方法和说明 |
---|---|
Response |
data(java.lang.Object obj) |
static Response |
error(int status,
java.lang.String errorCode,
java.lang.String errorMsg)
失败的响应
|
static Response |
error(java.lang.String errorCode,
java.lang.String errorMsg)
失败的响应
|
Response |
errorCode(java.lang.String errorCode) |
Response |
errorMsg(java.lang.String errorMsg) |
java.lang.Object |
getData() |
java.lang.String |
getErrorCode() |
java.lang.String |
getErrorMsg() |
int |
getStatus() |
static Response |
ok(java.lang.Object obj)
成功的响应,关注结果
|
void |
setData(java.lang.Object data) |
void |
setErrorCode(java.lang.String errorCode) |
void |
setErrorMsg(java.lang.String errorMsg) |
void |
setStatus(int status) |
Response |
status(int statusCode) |
static Response |
success()
成功的响应,不关注结果
|
static Response |
success(int successNum)
成功的响应,关注操作成功条目数
|
public Response status(int statusCode)
public Response errorCode(java.lang.String errorCode)
public Response errorMsg(java.lang.String errorMsg)
public Response data(java.lang.Object obj)
public java.lang.Object getData()
public void setData(java.lang.Object data)
public java.lang.String getErrorCode()
public void setErrorCode(java.lang.String errorCode)
public java.lang.String getErrorMsg()
public void setErrorMsg(java.lang.String errorMsg)
public int getStatus()
public void setStatus(int status)
public static Response ok(java.lang.Object obj)
obj
- 响应结果public static Response success()
public static Response success(int successNum)
successNum
- 操作成功的条目数public static Response error(int status, java.lang.String errorCode, java.lang.String errorMsg)
status
- 状态码errorCode
- 错误码errorMsg
- 错误信息public static Response error(java.lang.String errorCode, java.lang.String errorMsg)
errorCode
- 错误码errorMsg
- 错误信息