代码拉取完成,页面将自动刷新
/*
* @Author: i@douxuefeng.cn
* @Date: 2023-01-07 00:34:46
* @LastEditTime: 2023-01-07 17:18:28
* @LastEditors: i@douxuefeng.cn
* @Description:
* @FilePath: /iris-api/Volumes/Data/jobs/go-utils/wechat/mp/params/base_msg.go
*/
package params
import "encoding/xml"
type BaseMsg struct {
ToUserName string `xml:"ToUserName"`
FromUserName string `xml:"FromUserName"`
CreateTime int64 `xml:"CreateTime"`
MsgType string `xml:"MsgType"`
MsgId int64 `xml:"MsgId"`
MsgDataId string `xml:"MsgDataId"`
Idx int `xml:"Idx"`
Content string `xml:"Content"`
PicUrl string `xml:"PicUrl"`
MediaId string `xml:"MediaId"`
Format string `xml:"Format"`
ThumbMediaId string `xml:"ThumbMediaId"`
Location_X string `xml:"Location_X"`
Location_Y string `xml:"Location_Y"`
Scale string `xml:"Scale"`
Label string `xml:"Label"`
Title string `xml:"Title"`
Url string `xml:"Url"`
Description string `xml:"Description"`
Event string `xml:"Event"`
EventKey string `xml:"EventKey"`
Ticket string `xml:"Ticket"`
// EventLocation
Latitude string `xml:"Latitude"`
Longitude string `xml:"Longitude"`
Precision string `xml:"Precision"`
}
type CDATA string
func (c CDATA) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
return e.EncodeElement(struct {
string `xml:",cdata"`
}{string(c)}, start)
}
type Article struct {
XMLName xml.Name `xml:"item"`
Title string `xml:"Title"`
Description string `xml:"Description"`
PicUrl string `xml:"PicUrl"`
Url string `xml:"Url"`
}
type BaseMsgReply struct {
XMLName struct{} `xml:"xml"`
ToUserName string `xml:"ToUserName"`
FromUserName string `xml:"FromUserName"`
CreateTime int64 `xml:"CreateTime"`
MsgType string `xml:"MsgType"`
// text消息
Content CDATA `xml:"Content,omitempty"`
// image消息
Image struct {
MediaId string `xml:"MediaId"`
} `xml:"Image,omitempty"`
// voice消息
Voice struct {
MediaId string `xml:"MediaId"`
} `xml:"Voice,omitempty"`
// video消息
Video struct {
MediaId string `xml:"MediaId"`
Title string `xml:"Title"`
Description string `xml:"Description" `
} `xml:"Video,omitempty"`
// music 消息
Music struct {
Title string `xml:"Title"`
Description string `xml:"Description"`
MusicUrl string `xml:"MusicUrl"`
HQMusicUrl string `xml:"HQMusicUrl"`
ThumbMediaId string `xml:"ThumbMediaId"`
} `xml:"Music,omitempty"`
// news消息
ArticleCount int `xml:"ArticleCount"`
Articles *[]Article `xml:"Articles>Article"`
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。