forked from chanxuehong/wechat
/
mixed_msg.go
150 lines (136 loc) · 6.64 KB
/
mixed_msg.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
package core
type (
MsgType string
EventType string
)
// 微信服务器推送过来的消息(事件)的通用消息头.
type MsgHeader struct {
ToUserName string `xml:"ToUserName" json:"ToUserName"`
FromUserName string `xml:"FromUserName" json:"FromUserName"`
CreateTime int64 `xml:"CreateTime" json:"CreateTime"`
MsgType MsgType `xml:"MsgType" json:"MsgType"`
}
// 微信服务器推送过来的消息(事件)的合集.
type MixedMsg struct {
XMLName struct{} `xml:"xml" json:"-"`
MsgHeader
EventType EventType `xml:"Event" json:"Event"`
MsgId int64 `xml:"MsgId" json:"MsgId"` // request
Content string `xml:"Content" json:"Content"` // request
MediaId string `xml:"MediaId" json:"MediaId"` // request
PicURL string `xml:"PicUrl" json:"PicUrl"` // request
Format string `xml:"Format" json:"Format"` // request
Recognition string `xml:"Recognition" json:"Recognition"` // request
ThumbMediaId string `xml:"ThumbMediaId" json:"ThumbMediaId"` // request
LocationX float64 `xml:"Location_X" json:"Location_X"` // request
LocationY float64 `xml:"Location_Y" json:"Location_Y"` // request
Scale int `xml:"Scale" json:"Scale"` // request
Label string `xml:"Label" json:"Label"` // request
Title string `xml:"Title" json:"Title"` // request
Description string `xml:"Description" json:"Description"` // request
URL string `xml:"Url" json:"Url"` // request
EventKey string `xml:"EventKey" json:"EventKey"` // request, menu
Ticket string `xml:"Ticket" json:"Ticket"` // request
Latitude float64 `xml:"Latitude" json:"Latitude"` // request
Longitude float64 `xml:"Longitude" json:"Longitude"` // request
Precision float64 `xml:"Precision" json:"Precision"` // request
// menu
MenuId int64 `xml:"MenuId" json:"MenuId"`
ScanCodeInfo *struct {
ScanType string `xml:"ScanType" json:"ScanType"`
ScanResult string `xml:"ScanResult" json:"ScanResult"`
} `xml:"ScanCodeInfo,omitempty" json:"ScanCodeInfo,omitempty"`
SendPicsInfo *struct {
Count int `xml:"Count" json:"Count"`
PicList []struct {
PicMd5Sum string `xml:"PicMd5Sum" json:"PicMd5Sum"`
} `xml:"PicList>item,omitempty" json:"PicList,omitempty"`
} `xml:"SendPicsInfo,omitempty" json:"SendPicsInfo,omitempty"`
SendLocationInfo *struct {
LocationX float64 `xml:"Location_X" json:"Location_X"`
LocationY float64 `xml:"Location_Y" json:"Location_Y"`
Scale int `xml:"Scale" json:"Scale"`
Label string `xml:"Label" json:"Label"`
PoiName string `xml:"Poiname" json:"Poiname"`
} `xml:"SendLocationInfo,omitempty" json:"SendLocationInfo,omitempty"`
MsgID int64 `xml:"MsgID" json:"MsgID"` // template, mass
Status string `xml:"Status" json:"Status"` // template, mass
*mass // mass
*account // account
*dkf // dkf
*poi // poi
*card // card
*bizwifi // bizwifi
*file // MsgType is file
// shakearound
ChosenBeacon *struct {
UUID string `xml:"Uuid" json:"Uuid"`
Major int `xml:"Major" json:"Major"`
Minor int `xml:"Minor" json:"Minor"`
Distance float64 `xml:"Distance" json:"Distance"`
} `xml:"ChosenBeacon,omitempty" json:"ChosenBeacon,omitempty"`
AroundBeacons []struct {
UUID string `xml:"Uuid" json:"Uuid"`
Major int `xml:"Major" json:"Major"`
Minor int `xml:"Minor" json:"Minor"`
Distance float64 `xml:"Distance" json:"Distance"`
} `xml:"AroundBeacons>AroundBeacon,omitempty" json:"AroundBeacons,omitempty"`
}
type mass struct {
//MsgID int64 `xml:"MsgID" json:"MsgID"`
//Status string `xml:"Status" json:"Status"`
TotalCount int `xml:"TotalCount" json:"TotalCount"`
FilterCount int `xml:"FilterCount" json:"FilterCount"`
SentCount int `xml:"SentCount" json:"SentCount"`
ErrorCount int `xml:"ErrorCount" json:"ErrorCount"`
}
type account struct {
ExpiredTime int64 `xml:"ExpiredTime" json:"ExpiredTime"`
FailTime int64 `xml:"FailTime" json:"FailTime"`
FailReason string `xml:"FailReason" json:"FailReason"`
}
type dkf struct {
KfAccount string `xml:"KfAccount" json:"KfAccount"`
FromKfAccount string `xml:"FromKfAccount" json:"FromKfAccount"`
ToKfAccount string `xml:"ToKfAccount" json:"ToKfAccount"`
}
type poi struct {
UniqId string `xml:"UniqId" json:"UniqId"`
PoiId int64 `xml:"PoiId" json:"PoiId"`
Result string `xml:"Result" json:"Result"`
Msg string `xml:"Msg" json:"Msg"`
}
type card struct {
CardId string `xml:"CardId" json:"CardId"`
RefuseReason string `xml:"RefuseReason" json:"RefuseReason"`
IsGiveByFriend int `xml:"IsGiveByFriend" json:"IsGiveByFriend"`
FriendUserName string `xml:"FriendUserName" json:"FriendUserName"`
UserCardCode string `xml:"UserCardCode" json:"UserCardCode"`
OldUserCardCode string `xml:"OldUserCardCode" json:"OldUserCardCode"`
ConsumeSource string `xml:"ConsumeSource" json:"ConsumeSource"`
OuterId int64 `xml:"OuterId" json:"OuterId"`
LocationName string `xml:"LocationName" json:"LocationName"`
StaffOpenId string `xml:"StaffOpenId" json:"StaffOpenId"`
VerifyCode string `xml:"VerifyCode" json:"VerifyCode"`
RemarkAmount string `xml:"RemarkAmount" json:"RemarkAmount"`
OuterStr string `xml:"OuterStr" json:"OuterStr"`
Detail string `xml:"Detail" json:"Detail"`
IsReturnBack int `xml:"IsReturnBack" json:"IsReturnBack"`
IsChatRoom int `xml:"IsChatRoom" json:"IsChatRoom"`
IsRestoreMemberCard int `xml:"IsRestoreMemberCard" json:"IsRestoreMemberCard"`
IsRecommendByFriend int `xml:"IsRecommendByFriend" json:"IsRecommendByFriend"`
PageId string `xml:"PageId" json:"PageId"`
OrderId string `xml:"OrderId" json:"OrderId"`
}
type bizwifi struct {
ConnectTime int64 `xml:"ConnectTime" json:"ConnectTime"`
ExpireTime int64 `xml:"ExpireTime" json:"ExpireTime"`
VendorId string `xml:"VendorId" json:"VendorId"`
PlaceId int64 `xml:"PlaceId" json:"PlaceId"`
DeviceNo string `xml:"DeviceNo" json:"DeviceNo"`
}
type file struct {
FileKey string `xml:"FileKey" json:"FileKey"`
FileMd5 string `xml:"FileMd5" json:"FileMd5"`
FileTotalLen string `xml:"FileTotalLen" json:"FileTotalLen"`
}