View Javadoc
1   package com.foxinmy.weixin4j.tuple;
2   
3   import java.io.Serializable;
4   
5   import javax.xml.bind.annotation.XmlElement;
6   
7   import com.alibaba.fastjson.annotation.JSONCreator;
8   import com.alibaba.fastjson.annotation.JSONField;
9   
10  /**
11   * 客服消息图文
12   *
13   * @className Article
14   * @author jinyu(foxinmy@gmail.com)
15   * @date 2014年9月29日
16   * @since JDK 1.6
17   * @see
18   */
19  public class Article implements Serializable {
20  
21  	private static final long serialVersionUID = -1231352700301456395L;
22  
23  	/**
24  	 * 图文消息标题
25  	 */
26  	@XmlElement(name = "Title")
27  	private String title;
28  	/**
29  	 * 图文消息描述
30  	 */
31  	@JSONField(name = "description")
32  	@XmlElement(name = "Description")
33  	private String desc;
34  	/**
35  	 * 图片链接,支持JPG、PNG格式,较好的效果为大图360*200,小图200*200
36  	 */
37  	@JSONField(name = "picurl")
38  	@XmlElement(name = "PicUrl")
39  	private String picUrl;
40  	/**
41  	 * 点击图文消息跳转链接
42  	 */
43  	@XmlElement(name = "Url")
44  	private String url;
45  
46  	/**
47  	 *
48  	 * @param title
49  	 *            标题
50  	 * @param desc
51  	 *            描述
52  	 * @param picUrl
53  	 *            图片链接
54  	 * @param url
55  	 *            跳转URL
56  	 */
57  	@JSONCreator
58  	public Article(@JSONField(name = "title") String title,
59  			@JSONField(name = "desc") String desc,
60  			@JSONField(name = "picUrl") String picUrl,
61  			@JSONField(name = "url") String url) {
62  		this.title = title;
63  		this.desc = desc;
64  		this.picUrl = picUrl;
65  		this.url = url;
66  	}
67  
68  	public String getTitle() {
69  		return title;
70  	}
71  
72  	public String getDesc() {
73  		return desc;
74  	}
75  
76  	public String getPicUrl() {
77  		return picUrl;
78  	}
79  
80  	public String getUrl() {
81  		return url;
82  	}
83  
84  	@Override
85  	public String toString() {
86  		return "Article [title=" + title + ", desc=" + desc + ", picUrl="
87  				+ picUrl + ", url=" + url + "]";
88  	}
89  }