-
Notifications
You must be signed in to change notification settings - Fork 156
/
event.go
260 lines (241 loc) · 7.4 KB
/
event.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
package models
import (
"github.com/ArtisanCloud/PowerWeChat/v3/src/kernel/contract"
"github.com/ArtisanCloud/PowerWeChat/v3/src/kernel/models"
)
const (
CALLBACK_EVENT_SUBSCRIBE = "subscribe"
CALLBACK_EVENT_UNSUBSCRIBE = "unsubscribe"
CALLBACK_EVENT_ENTER_AGENT = "enter_agent"
CALLBACK_EVENT_LOCATION = "LOCATION"
CALLBACK_EVENT_BATCH_JOB_RESULT = "batch_job_result"
CALLBACK_EVENT_CLICK = "click"
CALLBACK_EVENT_VIEW = "view"
CALLBACK_EVENT_SCANCODE_PUSH = "scancode_push"
CALLBACK_EVENT_SCANCODE_WAITMSG = "scancode_waitmsg"
CALLBACK_EVENT_PIC_SYSPHOTO = "pic_sysphoto"
CALLBACK_EVENT_PIC_PHOTO_OR_ALBUM = "pic_photo_or_album"
CALLBACK_EVENT_PIC_WEIXIN = "pic_weixin"
CALLBACK_EVENT_LOCATION_SELECT = "location_select"
CALLBACK_EVENT_OPEN_APPROVAL_CHANGE = "open_approval_change"
CALLBACK_EVENT_SHARE_AGENT_CHANGE = "share_agent_change"
CALLBACK_EVENT_TEMPLATE_CARD_MENU_EVENT = "template_card_menu_event"
)
type EventSubscribe struct {
contract.EventInterface
models.CallbackMessageHeader
AgentID string `xml:"AgentID"`
}
type EventUnSubscribe struct {
contract.EventInterface
models.CallbackMessageHeader
AgentID string `xml:"AgentID"`
}
type EventEnterAgent struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
AgentID string `xml:"AgentID"`
}
type EventLocation struct {
contract.EventInterface
models.CallbackMessageHeader
Latitude string `xml:"Latitude"`
Longitude string `xml:"Longitude"`
Precision string `xml:"Precision"`
AgentID string `xml:"AgentID"`
AppType string `xml:"AppType"`
}
type EventBatchJobResult struct {
contract.EventInterface
models.CallbackMessageHeader
BatchJob struct {
Text string `xml:",chardata"`
JobID string `xml:"JobId"`
JobType string `xml:"JobType"`
ErrCode string `xml:"ErrCode"`
ErrMsg string `xml:"ErrMsg"`
} `xml:"BatchJob"`
}
type EventClick struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
AgentID string `xml:"AgentID"`
}
type EventView struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
AgentID string `xml:"AgentID"`
}
type EventScanCodePush struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
ScanCodeInfo struct {
Text string `xml:",chardata"`
ScanType string `xml:"ScanType"`
ScanResult string `xml:"ScanResult"`
} `xml:"ScanCodeInfo"`
AgentID string `xml:"AgentID"`
}
type EventScancodeWaitMsg struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
ScanCodeInfo struct {
Text string `xml:",chardata"`
ScanType string `xml:"ScanType"`
ScanResult string `xml:"ScanResult"`
} `xml:"ScanCodeInfo"`
AgentID string `xml:"AgentID"`
}
type EventPicSysPhoto struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
SendPicsInfo struct {
Text string `xml:",chardata"`
Count string `xml:"Count"`
PicList struct {
Text string `xml:",chardata"`
Item struct {
Text string `xml:",chardata"`
PicMd5Sum string `xml:"PicMd5Sum"`
} `xml:"item"`
} `xml:"PicList"`
} `xml:"SendPicsInfo"`
AgentID string `xml:"AgentID"`
}
type EventPicPhotoOrAlbum struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
SendPicsInfo struct {
Text string `xml:",chardata"`
Count string `xml:"Count"`
PicList struct {
Text string `xml:",chardata"`
Item struct {
Text string `xml:",chardata"`
PicMd5Sum string `xml:"PicMd5Sum"`
} `xml:"item"`
} `xml:"PicList"`
} `xml:"SendPicsInfo"`
AgentID string `xml:"AgentID"`
}
type EventPicWeixin struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
SendPicsInfo struct {
Text string `xml:",chardata"`
Count string `xml:"Count"`
PicList struct {
Text string `xml:",chardata"`
Item struct {
Text string `xml:",chardata"`
PicMd5Sum string `xml:"PicMd5Sum"`
} `xml:"item"`
} `xml:"PicList"`
} `xml:"SendPicsInfo"`
AgentID string `xml:"AgentID"`
}
type EventLocationSelect struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
SendLocationInfo struct {
Text string `xml:",chardata"`
LocationX string `xml:"Location_X"`
LocationY string `xml:"Location_Y"`
Scale string `xml:"Scale"`
Label string `xml:"Label"`
Poiname string `xml:"Poiname"`
} `xml:"SendLocationInfo"`
AgentID string `xml:"AgentID"`
AppType string `xml:"AppType"`
}
type EventOpenApprovalChange struct {
contract.EventInterface
models.CallbackMessageHeader
AgentID string `xml:"AgentID"`
ApprovalInfo struct {
Text string `xml:",chardata"`
ThirdNo string `xml:"ThirdNo"`
OpenSpName string `xml:"OpenSpName"`
OpenTemplateID string `xml:"OpenTemplateId"`
OpenSpStatus string `xml:"OpenSpStatus"`
ApplyTime string `xml:"ApplyTime"`
ApplyUserName string `xml:"ApplyUserName"`
ApplyUserID string `xml:"ApplyUserId"`
ApplyUserParty string `xml:"ApplyUserParty"`
ApplyUserImage string `xml:"ApplyUserImage"`
ApprovalNodes struct {
Text string `xml:",chardata"`
ApprovalNode struct {
Text string `xml:",chardata"`
NodeStatus string `xml:"NodeStatus"`
NodeAttr string `xml:"NodeAttr"`
NodeType string `xml:"NodeType"`
Items struct {
Text string `xml:",chardata"`
Item struct {
Text string `xml:",chardata"`
ItemName string `xml:"ItemName"`
ItemUserID string `xml:"ItemUserId"`
ItemImage string `xml:"ItemImage"`
ItemStatus string `xml:"ItemStatus"`
ItemSpeech string `xml:"ItemSpeech"`
ItemOpTime string `xml:"ItemOpTime"`
} `xml:"Item"`
} `xml:"Items"`
} `xml:"ApprovalNode"`
} `xml:"ApprovalNodes"`
NotifyNodes struct {
Text string `xml:",chardata"`
NotifyNode struct {
Text string `xml:",chardata"`
ItemName string `xml:"ItemName"`
ItemUserID string `xml:"ItemUserId"`
ItemImage string `xml:"ItemImage"`
} `xml:"NotifyNode"`
} `xml:"NotifyNodes"`
Approverstep string `xml:"approverstep"`
} `xml:"ApprovalInfo"`
}
type EventShareAgentChange struct {
contract.EventInterface
models.CallbackMessageHeader
AgentID string `xml:"AgentID"`
}
type EventTemplateCardEvent struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
TaskID string `xml:"TaskId"`
CardType string `xml:"CardType"`
ResponseCode string `xml:"ResponseCode"`
AgentID string `xml:"AgentID"`
SelectedItems struct {
Text string `xml:",chardata"`
SelectedItem []struct {
Text string `xml:",chardata"`
QuestionKey string `xml:"QuestionKey"`
OptionIds struct {
Text string `xml:",chardata"`
OptionID []string `xml:"OptionId"`
} `xml:"OptionIds"`
} `xml:"SelectedItem"`
} `xml:"SelectedItems"`
}
type EventTemplateCardMenuEvent struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
TaskID string `xml:"TaskId"`
CardType string `xml:"CardType"`
ResponseCode string `xml:"ResponseCode"`
AgentID string `xml:"AgentID"`
}