OAuthResult.java
1.48 KB
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
package com.zteits.oa.report.vo;
import com.zteits.oa.api.base.constants.ErrorType;
import com.zteits.oa.api.dto.asraop.LoginOathRes;
/**
* Copyright: Copyright (c) 2017 zteits
*
* @ClassName: com.zteits.oauth.portal.vo
* @Description:
* @version: v1.0.0
* @author: atao
* @date: 2017/5/9 下午3:39
* Modification History:
* Date Author Version Description
* ---------------------------------------------------------*
* 2017/5/9 atao v1.0.0 创建
*/
public class OAuthResult<T extends LoginOathRes> {
private String code;
private String errMsg;
private T data;
public OAuthResult(boolean success) {
if (success) {
this.code = ErrorType.BIZ_SUCCESS.getCode();
this.errMsg = ErrorType.BIZ_SUCCESS.getMsg();
}
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getErrMsg() {
return errMsg;
}
public void setErrMsg(String errMsg) {
this.errMsg = errMsg;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
public void setErrorType(ErrorType errorType) {
this.code = errorType.getCode();
this.errMsg = errorType.getMsg();
}
public void setErrorType(ErrorType errorType, String errMsg) {
this.code = errorType.getCode();
this.errMsg = errMsg;
}
}