HttpResult.java 1.12 KB
Newer Older
liqin's avatar
liqin committed
1 2
package cn.wisenergy.chnmuseum.party.common.mvc;

liqin's avatar
liqin committed
3 4
public class HttpResult<T> {

liqin's avatar
liqin committed
5
    // 响应的状态码
liqin's avatar
liqin committed
6
    private Integer resultCode;
liqin's avatar
liqin committed
7 8

    // 响应的响应信息
liqin's avatar
liqin committed
9
    private String message;
liqin's avatar
liqin committed
10 11

    // 响应的响应体
liqin's avatar
liqin committed
12
    private T data;
liqin's avatar
liqin committed
13 14 15 16

    public HttpResult() {
    }

liqin's avatar
liqin committed
17 18 19
    public HttpResult(Integer resultCode, String message) {
        this.resultCode = resultCode;
        this.message = message;
liqin's avatar
liqin committed
20 21
    }

liqin's avatar
liqin committed
22 23 24
    public HttpResult(Integer resultCode, T data) {
        this.resultCode = resultCode;
        this.data = data;
liqin's avatar
liqin committed
25 26
    }

liqin's avatar
liqin committed
27 28 29 30
    public HttpResult(Integer resultCode, String message, T data) {
        this.resultCode = resultCode;
        this.message = message;
        this.data = data;
liqin's avatar
liqin committed
31 32
    }

liqin's avatar
liqin committed
33 34
    public Integer getResultCode() {
        return resultCode;
liqin's avatar
liqin committed
35 36
    }

liqin's avatar
liqin committed
37 38
    public void setResultCode(Integer resultCode) {
        this.resultCode = resultCode;
liqin's avatar
liqin committed
39 40
    }

liqin's avatar
liqin committed
41 42
    public String getMessage() {
        return message;
liqin's avatar
liqin committed
43 44
    }

liqin's avatar
liqin committed
45 46
    public void setMessage(String message) {
        this.message = message;
liqin's avatar
liqin committed
47 48
    }

liqin's avatar
liqin committed
49 50
    public T getData() {
        return data;
liqin's avatar
liqin committed
51 52
    }

liqin's avatar
liqin committed
53 54
    public void setData(T data) {
        this.data = data;
liqin's avatar
liqin committed
55 56
    }
}