xufenglei
2017-12-01 b41f303340d8c21dad9e1b2fd798a0957e7fd7d1
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
package com.moral.common.bean;
 
import java.io.Serializable;
 
import lombok.Data;
 
@Data
public class ResultBean<T>implements Serializable {
 
    private static final long serialVersionUID = 1L;
    
    public static final int FAIL = 0;
    public static final int SUCCESS = 1;
    public static final int NO_PERMISSION = 2;
    private String msg = "success";
    private int code = SUCCESS;
    private T data;
    public ResultBean() {
        super();
    }
    public ResultBean(T data) {
        super();
        this.data = data;
    }
    
    public ResultBean(Throwable e) {
        super();
        this.msg = e.toString();
        this.code = FAIL;
    }
    public ResultBean(String msg, int code) {
        super();
        this.msg = msg;
        this.code = code;
    }
    public ResultBean(int code) {
        super();
        this.code = code;
    }
}