forked from leelance/spring-boot-all
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
spring-boot-quartz/src/main/java/com/lance/quartz/common/json/ResponseBodyInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.lance.quartz.common.json; | ||
|
||
public class ResponseBodyInfo<T> { | ||
// 错误代码 | ||
private int errorCode; | ||
// 错误提示 | ||
private String errorText; | ||
|
||
// 返回对象 | ||
private T data; | ||
|
||
protected ResponseBodyInfo() { | ||
} | ||
|
||
protected ResponseBodyInfo(int errorCode, String errorText, T data) { | ||
this.errorCode = errorCode; | ||
this.errorText = errorText; | ||
this.data = data; | ||
} | ||
|
||
public int getErrorCode() { | ||
return errorCode; | ||
} | ||
|
||
public void setErrorCode(int errorCode) { | ||
this.errorCode = errorCode; | ||
} | ||
|
||
public String getErrorText() { | ||
return errorText; | ||
} | ||
|
||
public void setErrorText(String errorText) { | ||
this.errorText = errorText; | ||
} | ||
|
||
public T getData() { | ||
return data; | ||
} | ||
|
||
public void setData(T data) { | ||
this.data = data; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
final StringBuilder sb = new StringBuilder("ResponseBodyInfo{"); | ||
sb.append("errorCode=").append(errorCode); | ||
sb.append(", errorText='").append(errorText).append('\''); | ||
sb.append(", data=").append(data); | ||
sb.append('}'); | ||
return sb.toString(); | ||
} | ||
} |