View Javadoc
1   package com.foxinmy.weixin4j.mp.model;
2   
3   import com.alibaba.fastjson.JSONArray;
4   import com.alibaba.fastjson.JSONObject;
5   import com.foxinmy.weixin4j.http.weixin.ApiResult;
6   
7   /**
8    * 语义理解结果
9    * 
10   * @className SemResult
11   * @author jinyu(foxinmy@gmail.com)
12   * @date 2014年11月7日
13   * @since JDK 1.6
14   * @see <a href=
15   *      "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141241&token=&lang=zh_CN">语义理解</a>
16   */
17  public class SemResult extends ApiResult {
18  
19  	private static final long serialVersionUID = 9051214458161068387L;
20  	/**
21  	 * 用户的输入字符串
22  	 */
23  	private String query;
24  	/**
25  	 * 服务的全局类型id,详见协议文档中垂直服务协议定义
26  	 */
27  	private String type;
28  	/**
29  	 * 语义理解后的结构化标识,各服务不同
30  	 */
31  	private JSONObject semantic;
32  	/**
33  	 * 部分类别的结果
34  	 */
35  	private JSONArray result;
36  	/**
37  	 * 部分类别的结果html5展示,目前不支持
38  	 */
39  	private String answer;
40  	/**
41  	 * 特殊回复说明
42  	 */
43  	private String text;
44  
45  	public String getQuery() {
46  		return query;
47  	}
48  
49  	public void setQuery(String query) {
50  		this.query = query;
51  	}
52  
53  	public String getType() {
54  		return type;
55  	}
56  
57  	public void setType(String type) {
58  		this.type = type;
59  	}
60  
61  	public JSONObject getSemantic() {
62  		return semantic;
63  	}
64  
65  	public void setSemantic(JSONObject semantic) {
66  		this.semantic = semantic;
67  	}
68  
69  	public JSONArray getResult() {
70  		return result;
71  	}
72  
73  	public void setResult(JSONArray result) {
74  		this.result = result;
75  	}
76  
77  	public String getAnswer() {
78  		return answer;
79  	}
80  
81  	public void setAnswer(String answer) {
82  		this.answer = answer;
83  	}
84  
85  	public String getText() {
86  		return text;
87  	}
88  
89  	public void setText(String text) {
90  		this.text = text;
91  	}
92  
93  	@Override
94  	public String toString() {
95  		return "SemResult [query=" + query + ", type=" + type + ", semantic=" + semantic
96  				+ ", result=" + result + ", answer=" + answer + ", " + super.toString() + "]";
97  	}
98  }