Ver Fonte

wechat reply message text

ls há 5 anos atrás
pai
commit
ff7392a717
1 ficheiros alterados com 19 adições e 16 exclusões
  1. 19 16
      wechat/structure.go

+ 19 - 16
wechat/structure.go

@@ -77,8 +77,8 @@ type Message struct {
 	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"`
+	// 文本 Text Text message
+	Text string `xml:"Content,omitempty" json:"Content,omitempty"`
 
 	// 图片 PicURL / MediaID image messgae
 	PicURL  string `xml:"PicUrl,omitempty" json:"PicUrl,omitempty"`
@@ -237,7 +237,8 @@ type UserList struct {
 	NextOpenID string `json:"next_openid"`
 }
 
-type newsitem struct {
+// MaterialNewsItem 图片素材
+type MaterialNewsItem struct {
 	Title              string `json:"title"`
 	Author             string `json:"author"`
 	Digest             string `json:"digest"`
@@ -251,25 +252,27 @@ type newsitem struct {
 	OnlyFansCanComment int    `json:"only_fans_can_comment"`
 }
 
-type content struct {
-	NewsItem   []*newsitem `json:"news_item,omitempty"`
-	CreateTime int         `json:"create_time,omitempty"`
-	UpdateTime int         `json:"update_time,omitempty"`
+// MaterialContent 素材内容
+type MaterialContent struct {
+	NewsItem   []*MaterialNewsItem `json:"news_item,omitempty"`
+	CreateTime int                 `json:"create_time,omitempty"`
+	UpdateTime int                 `json:"update_time,omitempty"`
 }
 
-type item struct {
-	MediaID    string   `json:"media_id"`
-	Name       string   `json:"name,omitempty"`
-	UpdateTime int      `json:"update_time"`
-	URL        string   `json:"url,omitempty"`
-	Content    *content `json:"content,omitempty"`
+// MaterialItem 素材信息
+type MaterialItem struct {
+	MediaID    string           `json:"media_id"`
+	Name       string           `json:"name,omitempty"`
+	UpdateTime int              `json:"update_time"`
+	URL        string           `json:"url,omitempty"`
+	Content    *MaterialContent `json:"content,omitempty"`
 }
 
 // Material 素材
 type Material struct {
-	TotalCount int    `json:"total_count"`
-	ItemCount  int    `json:"item_count"`
-	Item       []item `json:"item"`
+	TotalCount int            `json:"total_count"`
+	ItemCount  int            `json:"item_count"`
+	Item       []MaterialItem `json:"item"`
 }
 
 // MiniProgramPage mini