|
@@ -74,11 +74,84 @@ type Message struct {
|
|
XMLName xml.Name `xml:"xml"`
|
|
XMLName xml.Name `xml:"xml"`
|
|
ToUserName string `xml:"ToUserName" json:"ToUserName"`
|
|
ToUserName string `xml:"ToUserName" json:"ToUserName"`
|
|
FromUserName string `xml:"FromUserName" json:"FromUserName"`
|
|
FromUserName string `xml:"FromUserName" json:"FromUserName"`
|
|
- CreateTime int32 `xml:"CreateTime" json:"CreateTime"`
|
|
|
|
- MsgType string `xml:"MsgType" json:"MsgType"`
|
|
|
|
- MsgID int64 `xml:"MsgId" json:"MsgId"`
|
|
|
|
|
|
+ CreateTime int64 `xml:"CreateTime" json:"CreateTime"`
|
|
|
|
+ MsgType string `xml:"MsgType" json:"MsgType"` // text/image/voice/video/shortvideo/location/link
|
|
|
|
+
|
|
|
|
+ // 文本 Content Text message
|
|
|
|
+ Content string `xml:"Content,omitempty" json:"Content,omitempty"`
|
|
|
|
+
|
|
|
|
+ // 图片 PicURL / MediaID image messgae
|
|
|
|
+ PicURL string `xml:"PicUrl,omitempty" json:"PicUrl,omitempty"`
|
|
|
|
+ MediaID string `xml:"MediaId,omitempty" json:"MediaId,omitempty"`
|
|
|
|
+
|
|
|
|
+ // 语音 MediaID / Format voice message
|
|
|
|
+ Format string `xml:"Format,omitempty" json:"Format,omitempty"`
|
|
|
|
+
|
|
|
|
+ // 视频/小视频 ThumbMediaID / MediaID video/shortvideo message
|
|
|
|
+ ThumbMediaID string `xml:"ThumbMediaId,omitempty" json:"ThumbMediaId,omitempty"`
|
|
|
|
+
|
|
|
|
+ // 地理位置 location message
|
|
|
|
+ LocationX string `xml:"Location_X,omitempty" json:"Location_X,omitempty"` // 经度
|
|
|
|
+ LocationY string `xml:"Location_Y,omitempty" json:"Location_Y,omitempty"` // 纬度
|
|
|
|
+ Scale string `xml:"Scale,omitempty" json:"Scale,omitempty"` // 地图缩放大小
|
|
|
|
+ Label string `xml:"Label,omitempty" json:"Label,omitempty"` // 地理位置信息
|
|
|
|
+
|
|
|
|
+ // 链接消息 link
|
|
|
|
+ Title string `xml:"Title,omitempty" json:"Title,omitempty"` // 消息标题
|
|
|
|
+ Description string `xml:"Description,omitempty" json:"Description,omitempty"` // 消息描述
|
|
|
|
+ URL string `xml:"Url,omitempty" json:"Url,omitempty"` // 消息链接
|
|
|
|
+
|
|
|
|
+ Event string `xml:"Event,omitempty" json:"Event,omitempty"` // 事件 subscribe(订阅)、unsubscribe(取消订阅)
|
|
|
|
+
|
|
|
|
+ MsgID int64 `xml:"MsgId,omitempty" json:"MsgId,omitempty"` // 消息id
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// ArticleItem article item
|
|
|
|
+type ArticleItem struct {
|
|
|
|
+ Title string `xml:"Title" json:"Title"`
|
|
|
|
+ Description string `xml:"Description" json:"Description"`
|
|
|
|
+ PicURL string `xml:"PicUrl" json:"PicUrl"`
|
|
|
|
+ URL string `xml:"Url" json:"Url"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type articleItems struct {
|
|
|
|
+ Items []ArticleItem `xml:"item" json:"item"`
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// ReplyMessage reply message
|
|
|
|
+type ReplyMessage struct {
|
|
|
|
+ XMLName xml.Name `xml:"xml"`
|
|
|
|
+ ToUserName string `xml:"ToUserName" json:"ToUserName"`
|
|
|
|
+ FromUserName string `xml:"FromUserName" json:"FromUserName"`
|
|
|
|
+ CreateTime int64 `xml:"CreateTime" json:"CreateTime"`
|
|
|
|
+ MsgType string `xml:"MsgType" json:"MsgType"` // text/image/voice/video/music/news
|
|
|
|
+
|
|
|
|
+ // 文本 Content Text message
|
|
|
|
+ Content string `xml:"Content,omitempty" json:"Content,omitempty"`
|
|
|
|
+
|
|
|
|
+ // image
|
|
|
|
+ ArticleCount int `xml:"ArticleCount,omitempty" json:"ArticleCount,omitempty"`
|
|
|
|
+ Articles *articleItems `xml:"Articles,omitempty" json:"Articles,omitempty"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+<xml>
|
|
|
|
+ <ToUserName><![CDATA[toUser]]></ToUserName>
|
|
|
|
+ <FromUserName><![CDATA[fromUser]]></FromUserName>
|
|
|
|
+ <CreateTime>12345678</CreateTime>
|
|
|
|
+ <MsgType><![CDATA[news]]></MsgType>
|
|
|
|
+ <ArticleCount>1</ArticleCount>
|
|
|
|
+ <Articles>
|
|
|
|
+ <item>
|
|
|
|
+ <Title><![CDATA[title1]]></Title>
|
|
|
|
+ <Description><![CDATA[description1]]></Description>
|
|
|
|
+ <PicUrl><![CDATA[picurl]]></PicUrl>
|
|
|
|
+ <Url><![CDATA[url]]></Url>
|
|
|
|
+ </item>
|
|
|
|
+ </Articles>
|
|
|
|
+</xml>
|
|
|
|
+// */
|
|
|
|
+
|
|
// EventTemplateReply event reply
|
|
// EventTemplateReply event reply
|
|
type EventTemplateReply struct {
|
|
type EventTemplateReply struct {
|
|
XMLName xml.Name `xml:"xml"`
|
|
XMLName xml.Name `xml:"xml"`
|