View Javadoc
1   package com.foxinmy.weixin4j.message;
2   
3   import javax.xml.bind.annotation.XmlElement;
4   
5   import com.foxinmy.weixin4j.request.WeixinMessage;
6   import com.foxinmy.weixin4j.type.MessageType;
7   
8   /**
9    * 图片消息
10   * 
11   * @className ImageMessage
12   * @author jinyu(foxinmy@gmail.com)
13   * @date 2014年4月6日
14   * @since JDK 1.6
15   * @see <a
16   *      href="https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140453&token=&lang=zh_CN">订阅号、服务号的图片消息</a>
17   * @see <a
18   *      href="http://qydev.weixin.qq.com/wiki/index.php?title=%E6%8E%A5%E6%94%B6%E6%99%AE%E9%80%9A%E6%B6%88%E6%81%AF#image.E6.B6.88.E6.81.AF">企业号的图片消息</a>
19   */
20  public class ImageMessage extends WeixinMessage {
21  
22  	private static final long serialVersionUID = 8430800898756567016L;
23  
24  	public ImageMessage() {
25  		super(MessageType.image.name());
26  	}
27  
28  	/**
29  	 * 图片链接
30  	 */
31  	@XmlElement(name = "PicUrl")
32  	private String picUrl;
33  	/**
34  	 * 图片消息媒体id,可以调用多媒体文件下载接口拉取数据。
35  	 */
36  	@XmlElement(name = "MediaId")
37  	private String mediaId;
38  
39  	public String getPicUrl() {
40  		return picUrl;
41  	}
42  
43  	public String getMediaId() {
44  		return mediaId;
45  	}
46  
47  	@Override
48  	public String toString() {
49  		return "ImageMessage [picUrl=" + picUrl + ", mediaId=" + mediaId + ", "
50  				+ super.toString() + "]";
51  	}
52  }