1 Star 1 Fork 0

窦雪峰/go-utils

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
base_msg.go 2.56 KB
一键复制 编辑 原始数据 按行查看 历史
窦雪峰 提交于 2023-01-09 23:09 +08:00 . add media base_msg
/*
* @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"`
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/douxuefeng/go-utils.git
git@gitee.com:douxuefeng/go-utils.git
douxuefeng
go-utils
go-utils
v1.0.0

搜索帮助