Blame view

src/main/java/com/zteits/oa/api/base/bean/BizResult.java 1.25 KB
1b9e8898   王富生   提交
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
  package com.zteits.oa.api.base.bean;
  
  import com.zteits.oa.api.base.constants.ErrorType;
  
  /**
   * 统一返回结果集
   * 
   * Copyright: Copyright (c) 2017  zteits
   * 
   * @ClassName: BizResult.java
   * @Description: 
   * @version: v1.0.0
   * @author: liuzl
   * @date: 2017424   下午6:17:24 
   * Modification History:
   * Date             Author          Version            Description
   *---------------------------------------------------------*
   * 2017424      liuzl           v1.0.0               创建
   */
  public class BizResult<T> extends ResultBean<ErrorCode, T>{
  
  	private static final long serialVersionUID = 1L;
  	
  	public BizResult() {
  		super();
  	}
  
  	public BizResult(ErrorCode errType, String errMsg) {
  		super(errType, errMsg);
  	}
  	
  	public BizResult(ErrorType errType, String errMsg) {
  		super(errType, errMsg);
  	}
  
  	public BizResult(ErrorType errType) {
  		super(errType);
  	}
  
  	public BizResult(T data) {
  		super(data);
  		this.errCode=ErrorType.BIZ_SUCCESS;
  		this.errMsg = ErrorType.BIZ_SUCCESS.getMsg();
  		
  	}
  
  	public BizResult(ErrorType errType, String errMsg, T data) {
  		super(errType, errMsg, data);
  	}
  	
  	public void setErrorInfo(ErrorType errType, String errMsg){
  		this.errCode = errType;
  		this.errMsg = errMsg;
  		this.success = false;
  	}
  	
  }