wanghc
2023-07-04 a042e0e63f86a0880d20e57c14ec4a60b65801fb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
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 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;
        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;
    }
 
 
 
    @Override
    public String toString() {
        return "ResponseVo{" + "errorCode=" + errorCode + ", errMsg='" + errMsg + '\'' + ", body=" + body + '}';
    }
}