View Javadoc
1   package com.foxinmy.weixin4j.http.weixin;
2   
3   import java.io.Serializable;
4   
5   import javax.xml.bind.annotation.XmlAccessType;
6   import javax.xml.bind.annotation.XmlAccessorType;
7   import javax.xml.bind.annotation.XmlElement;
8   import javax.xml.bind.annotation.XmlRootElement;
9   
10  import com.alibaba.fastjson.annotation.JSONField;
11  
12  /**
13   * 调用接口返回xml格式
14   * 
15   * @className XmlResult
16   * @author jinyu(foxinmy@gmail.com)
17   * @date 2014年11月1日
18   * @since JDK 1.6
19   * @see
20   */
21  @XmlRootElement
22  @XmlAccessorType(XmlAccessType.FIELD)
23  public class XmlResult implements Serializable {
24  
25  	private static final long serialVersionUID = -6185313616955051150L;
26  	/**
27  	 * 调用接口返回码,通信标识
28  	 */
29  	@XmlElement(name = "return_code")
30  	@JSONField(name = "return_code")
31  	private String returnCode;
32  
33  	/**
34  	 * 调用接口返回消息,如非 空,为错误原因 可能为空
35  	 */
36  	@XmlElement(name = "return_msg")
37  	@JSONField(name = "return_msg")
38  	private String returnMsg;
39  	/**
40  	 * 业务结果SUCCESS/FAIL 非空
41  	 */
42  	@XmlElement(name = "result_code")
43  	@JSONField(name = "result_code")
44  	private String resultCode;
45  	/**
46  	 * 错误代码 可为空
47  	 */
48  	@XmlElement(name = "err_code")
49  	@JSONField(name = "err_code")
50  	private String errCode;
51  	/**
52  	 * 结果信息描述 可为空
53  	 */
54  	@XmlElement(name = "err_code_des")
55  	@JSONField(name = "err_code_des")
56  	private String errCodeDes;
57  
58  	protected XmlResult() {
59  		// jaxb required
60  	}
61  
62  	public XmlResult(String returnCode, String returnMsg) {
63  		this.returnCode = returnCode;
64  		this.returnMsg = returnMsg;
65  	}
66  
67  	public String getResultCode() {
68  		return resultCode;
69  	}
70  
71  	public void setReturnCode(String returnCode) {
72  		this.returnCode = returnCode;
73  	}
74  
75  	public String getErrCode() {
76  		return errCode;
77  	}
78  
79  	public String getErrCodeDes() {
80  		return errCodeDes;
81  	}
82  
83  	public String getReturnCode() {
84  		return returnCode;
85  	}
86  
87  	public String getReturnMsg() {
88  		return returnMsg;
89  	}
90  
91  	public void setReturnMsg(String returnMsg) {
92  		this.returnMsg = returnMsg;
93  	}
94  
95  	public void setResultCode(String resultCode) {
96  		this.resultCode = resultCode;
97  	}
98  
99  	public void setErrCode(String errCode) {
100 		this.errCode = errCode;
101 	}
102 
103 	public void setErrCodeDes(String errCodeDes) {
104 		this.errCodeDes = errCodeDes;
105 	}
106 
107 	@Override
108 	public String toString() {
109 		return "returnCode=" + returnCode + ", returnMsg=" + returnMsg
110 				+ ", resultCode=" + resultCode + ", errCode=" + errCode
111 				+ ", errCodeDes=" + errCodeDes;
112 	}
113 }