xufenglei
2017-12-07 dba72443e05e7b0a52ee85bfd9f4641aebc42c60
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 SUCCESS = 0;
    public static final int FAIL = 1;
    public static final int NO_PERMISSION = 2;
    private String message = "success";
    private int errno = SUCCESS;
    private T data;
    public ResultBean() {
        super();
    }
    public ResultBean(T data) {
        super();
        this.data = data;
    }
    
    public ResultBean(Throwable e) {
        super();
        this.message = e.toString();
        this.errno = FAIL;
    }
    public ResultBean(String message, int errno) {
        super();
        this.message = message;
        this.errno = errno;
    }
    public ResultBean(int errno) {
        super();
        this.errno = errno;
    }
}