View Javadoc
1   package com.zone.weixin4j.message;
2   
3   import com.zone.weixin4j.request.WeixinMessage;
4   import com.zone.weixin4j.type.MessageType;
5   
6   import javax.xml.bind.annotation.XmlElement;
7   
8   /**
9    * 地理位置消息
10   * 
11   * @className LocationMessage
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#location.E6.B6.88.E6.81.AF">企业号的地理位置消息</a>
19   */
20  public class LocationMessage extends WeixinMessage {
21  
22  	private static final long serialVersionUID = 2866021596599237334L;
23  
24  	public LocationMessage() {
25  		super(MessageType.location.name());
26  	}
27  
28  	/**
29  	 * 地理位置维度
30  	 */
31  	@XmlElement(name = "Location_X")
32  	private double x;
33  	/**
34  	 * 地理位置经度
35  	 */
36  	@XmlElement(name = "Location_Y")
37  	private double y;
38  	/**
39  	 * 地图缩放大小
40  	 */
41  	@XmlElement(name = "Scale")
42  	private double scale;
43  	/**
44  	 * 地理位置信息
45  	 */
46  	@XmlElement(name = "Label")
47  	private String label;
48  
49  	public double getX() {
50  		return x;
51  	}
52  
53  	public double getY() {
54  		return y;
55  	}
56  
57  	public double getScale() {
58  		return scale;
59  	}
60  
61  	public String getLabel() {
62  		return label;
63  	}
64  
65  	@Override
66  	public String toString() {
67  		return "LocationMessage [x=" + x + ", y=" + y + ", scale=" + scale
68  				+ ", label=" + label + ", " + super.toString() + "]";
69  	}
70  }