package wechat

import "encoding/xml"

// MediaMessage 多媒体消息(视频、图片)
type MediaMessage struct {
	XMLName  xml.Name      `xml:"msg" json:"msg"`
	Text     string        `xml:",chardata" json:"-"`
	VideoMsg *VideoMessage `xml:"videomsg" json:"videoMsg,omitempty"`
	Img      *ImgMessage   `xml:"img" json:"img,omitempty"`
}

// ImgMessage 图片消息
type ImgMessage struct {
	Text           string `xml:",chardata"`
	AesKey         string `xml:"aeskey,attr"`
	EnCryVer       string `xml:"encryver,attr"`
	CdnThumbAesKey string `xml:"cdnthumbaeskey,attr"`
	CdnThumbUrl    string `xml:"cdnthumburl,attr"`
	CdnThumbLength string `xml:"cdnthumblength,attr"`
	CdnThumbHeight string `xml:"cdnthumbheight,attr"`
	CdnThumbWidth  string `xml:"cdnthumbwidth,attr"`
	CdnMidHeight   string `xml:"cdnmidheight,attr"`
	CdnMidWidth    string `xml:"cdnmidwidth,attr"`
	CdnMidImgUrl   string `xml:"cdnmidimgurl,attr"`
	CdnHdHeight    string `xml:"cdnhdheight,attr"`
	CdnHdWidth     string `xml:"cdnhdwidth,attr"`
	CdnBigImgUrl   string `xml:"cdnbigimgurl,attr"`
	Length         string `xml:"length,attr"`
	Md5            string `xml:"md5,attr"`
	HevcMidSize    string `xml:"hevc_mid_size,attr"`
}

// VideoMessage 视频消息
type VideoMessage struct {
	Text              string `xml:",chardata"`
	AesKey            string `xml:"aeskey,attr"`
	CdnVideoUrl       string `xml:"cdnvideourl,attr"`
	CdnThumbAesKey    string `xml:"cdnthumbaeskey,attr"`
	CdnThumbUrl       string `xml:"cdnthumburl,attr"`
	Length            string `xml:"length,attr"`
	PlayLength        string `xml:"playlength,attr"`
	CdnThumbLength    string `xml:"cdnthumblength,attr"`
	CdnThumbWidth     string `xml:"cdnthumbwidth,attr"`
	CdnThumbHeight    string `xml:"cdnthumbheight,attr"`
	FromUsername      string `xml:"fromusername,attr"`
	Md5               string `xml:"md5,attr"`
	NewMd5            string `xml:"newmd5,attr"`
	IsPlaceholder     string `xml:"isplaceholder,attr"`
	RawMd5            string `xml:"rawmd5,attr"`
	RawLength         string `xml:"rawlength,attr"`
	CdnRawVideoUrl    string `xml:"cdnrawvideourl,attr"`
	CdnRawVideoAesKey string `xml:"cdnrawvideoaeskey,attr"`
	OverWriteNewMsgId string `xml:"overwritenewmsgid,attr"`
	IsAd              string `xml:"isad,attr"`
}
