| | |
| | | |
| | | /** |
| | | * 基础返回对象 |
| | | * |
| | | * @author wanghc |
| | | * @version 1.0.0 |
| | | * @date 2023-03-07 |
| | |
| | | /** |
| | | * 错误码 等于0为成功 |
| | | */ |
| | | private int errorCode = 0; |
| | | private int errorCode = 0; |
| | | /** |
| | | * 异常信息 |
| | | */ |
| | | private String errMsg = "操作成功"; |
| | | private String errMsg = "操作成功"; |
| | | /** |
| | | * 内容对象 |
| | | */ |
| | | private Object body; |
| | | private Object body; |
| | | |
| | | public static ResponseVo ok(Object body) { |
| | | return new ResponseVo(body); |
| | | } |
| | | |
| | | |
| | | |
| | | public static ResponseVo ok() { |
| | | return new ResponseVo(); |
| | | } |
| | | |
| | | |
| | | |
| | | public static ResponseVo fail(int errorCode, String errMsg) { |
| | | return new ResponseVo(errorCode, errMsg, null); |
| | | } |
| | | |
| | | |
| | | |
| | | public ResponseVo() { |
| | | } |
| | | |
| | | |
| | | |
| | | public ResponseVo(int pErrorCode, String pErrMsg, Object pBody) { |
| | | errorCode = pErrorCode; |
| | |
| | | body = pBody; |
| | | } |
| | | |
| | | |
| | | |
| | | public ResponseVo(Object pBody) { |
| | | body = pBody; |
| | | } |
| | | |
| | | |
| | | |
| | | public int getErrorCode() { |
| | | return errorCode; |
| | | } |
| | | |
| | | |
| | | |
| | | public void setErrorCode(int pErrorCode) { |
| | | errorCode = pErrorCode; |
| | | } |
| | | |
| | | |
| | | |
| | | public String getErrMsg() { |
| | | return errMsg; |
| | | } |
| | | |
| | | |
| | | |
| | | public void setErrMsg(String pErrMsg) { |
| | | errMsg = pErrMsg; |
| | | } |
| | | |
| | | |
| | | |
| | | public Object getBody() { |
| | | return body; |
| | | } |
| | | |
| | | |
| | | |
| | | public ResponseVo setBody(Object pBody) { |
| | | body = pBody; |
| | | return this; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ResponseVo{" + "errorCode=" + errorCode + ", errMsg='" + errMsg + '\'' + ", body=" + body + '}'; |
| | | } |
| | | } |