package com.jttech.pfcs.vo.resp; import java.io.Serializable; /** * 基础返回对象 * @author wanghc * @version 1.0.0 * @date 2023-03-07 */ public class ResponseVo implements Serializable { private static final long serialVersionUID = 7564240277258758852L; /** * 错误码 等于0为成功 */ private int errorCode = 0; /** * 异常信息 */ private String errMsg = "操作成功"; /** * 内容对象 */ private Object body; public static ResponseVo ok(Object body) { return new ResponseVo(body); } 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; errMsg = pErrMsg; 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; } }