Explorar o código

增加一个 TemplateMsgID,适配微信微信msgID和msgId问题 (#266)

* 添加TODO:待完善接口

* 【模板消息】将message.DataItem改为message.TemplateDataItem

* fix PKG.DEV

* 增加一个 SetRedisPool 方法

* fix:模板消息推送增加一个TemplateMsgID
silenceper %!s(int64=6) %!d(string=hai) anos
pai
achega
6c06c05233
Modificáronse 1 ficheiros con 15 adicións e 14 borrados
  1. 15 14
      officialaccount/message/message.go

+ 15 - 14
officialaccount/message/message.go

@@ -89,20 +89,21 @@ type MixMessage struct {
 	CommonToken
 
 	//基本消息
-	MsgID        int64   `xml:"MsgId"`
-	Content      string  `xml:"Content"`
-	Recognition  string  `xml:"Recognition"`
-	PicURL       string  `xml:"PicUrl"`
-	MediaID      string  `xml:"MediaId"`
-	Format       string  `xml:"Format"`
-	ThumbMediaID string  `xml:"ThumbMediaId"`
-	LocationX    float64 `xml:"Location_X"`
-	LocationY    float64 `xml:"Location_Y"`
-	Scale        float64 `xml:"Scale"`
-	Label        string  `xml:"Label"`
-	Title        string  `xml:"Title"`
-	Description  string  `xml:"Description"`
-	URL          string  `xml:"Url"`
+	MsgID         int64   `xml:"MsgId"` //其他消息推送过来是MsgId
+	TemplateMsgID int64   `xml:"MsgID"` //模板消息推送成功的消息是MsgID
+	Content       string  `xml:"Content"`
+	Recognition   string  `xml:"Recognition"`
+	PicURL        string  `xml:"PicUrl"`
+	MediaID       string  `xml:"MediaId"`
+	Format        string  `xml:"Format"`
+	ThumbMediaID  string  `xml:"ThumbMediaId"`
+	LocationX     float64 `xml:"Location_X"`
+	LocationY     float64 `xml:"Location_Y"`
+	Scale         float64 `xml:"Scale"`
+	Label         string  `xml:"Label"`
+	Title         string  `xml:"Title"`
+	Description   string  `xml:"Description"`
+	URL           string  `xml:"Url"`
 
 	//事件相关
 	Event       EventType `xml:"Event"`