-
Notifications
You must be signed in to change notification settings - Fork 147
/
event.go
271 lines (233 loc) · 7.51 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
261
262
263
264
265
266
267
268
269
270
271
package models
import (
"github.com/ArtisanCloud/PowerWeChat/v3/src/kernel/contract"
"github.com/ArtisanCloud/PowerWeChat/v3/src/kernel/models"
)
// https://developer.work.weixin.qq.com/document/path/90967
const (
CALLBACK_EVENT_SUBSCRIBE = "subscribe"
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"
CALLBACK_EVENT_SYS_APPROVAL_CHANGE = "sys_approval_change"
CALLBACK_EVENT_KF_MSG_OR_EVENT = "kf_msg_or_event"
)
type EventSubscribe 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 BatchJob struct {
Text string `xml:",chardata"`
JobID string `xml:"JobId"`
JobType string `xml:"JobType"`
ErrCode string `xml:"ErrCode"`
ErrMsg string `xml:"ErrMsg"`
}
type EventBatchJobResult struct {
contract.EventInterface
models.CallbackMessageHeader
BatchJob *BatchJob `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 *ScanCodeInfo `xml:"ScanCodeInfo"`
AgentID string `xml:"AgentID"`
}
type ScanCodeInfo struct {
Text string `xml:",chardata"`
ScanType string `xml:"ScanType"`
ScanResult string `xml:"ScanResult"`
}
type EventScancodeWaitMsg struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
ScanCodeInfo *ScanCodeInfo `xml:"ScanCodeInfo"`
AgentID string `xml:"AgentID"`
}
type EventPicSysPhoto struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
SendPicsInfo *SendPicsInfo `xml:"SendPicsInfo"`
AgentID string `xml:"AgentID"`
}
type EventPicPhotoOrAlbum struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
SendPicsInfo *SendPicsInfo `xml:"SendPicsInfo"`
AgentID string `xml:"AgentID"`
}
type Item struct {
Text string `xml:",chardata"`
PicMd5Sum string `xml:"PicMd5Sum"`
}
type PicList struct {
Text string `xml:",chardata"`
Item *Item `xml:"item"`
}
type SendPicsInfo struct {
Text string `xml:",chardata"`
Count string `xml:"Count"`
PicList *PicList `xml:"PicList"`
}
type EventPicWeixin struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
SendPicsInfo SendPicsInfo `xml:"SendPicsInfo"`
AgentID string `xml:"AgentID"`
}
type 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"`
}
type EventLocationSelect struct {
contract.EventInterface
models.CallbackMessageHeader
EventKey string `xml:"EventKey"`
SendLocationInfo *SendLocationInfo `xml:"SendLocationInfo"`
AgentID string `xml:"AgentID"`
AppType string `xml:"AppType"`
}
// ----------------------------------------------------------------------------
type Applier struct {
Text string `xml:",chardata"`
UserID string `xml:"UserId"`
Party string `xml:"Party"`
}
type Approver struct {
Text string `xml:",chardata"`
UserID string `xml:"UserId"`
}
type Detail struct {
Text string `xml:",chardata"`
Approver *Approver `xml:"Approver"`
Speech string `xml:"Speech"`
SpStatus string `xml:"SpStatus"`
SpTime string `xml:"SpTime"`
}
type SPRecord struct {
Text string `xml:",chardata"`
SpStatus string `xml:"SpStatus"`
ApproverAttr string `xml:"ApproverAttr"`
Details []Detail `xml:"Details"`
}
type Notifier struct {
Text string `xml:",chardata"`
UserID string `xml:"UserId"`
}
type CommentUserInfo struct {
Text string `xml:",chardata"`
UserID string `xml:"UserId"`
}
type Comments struct {
Text string `xml:",chardata"`
CommentUserInfo *CommentUserInfo `xml:"CommentUserInfo"`
CommentTime string `xml:"CommentTime"`
CommentContent string `xml:"CommentContent"`
CommentID string `xml:"CommentId"`
}
type ApprovalInfo struct {
Text string `xml:",chardata"`
SpNO string `xml:"SpNo"`
SpName string `xml:"SpName"`
SpStatus string `xml:"SpStatus"`
TemplateID string `xml:"TemplateId"`
ApplyTime string `xml:"ApplyTime"`
Applier *Applier `xml:"Applyer"`
SpRecord []*SPRecord `xml:"SpRecord"`
Notifier *Notifier `xml:"Notifyer"`
Comments *Comments `xml:"Comments"`
StatusChangeEvent string `xml:"StatuChangeEvent"`
}
type EventOpenApprovalChange struct {
contract.EventInterface
models.CallbackMessageHeader
AgentID string `xml:"AgentID"`
ApprovalInfo *ApprovalInfo `xml:"ApprovalInfo"`
}
type EventShareAgentChange struct {
contract.EventInterface
models.CallbackMessageHeader
AgentID string `xml:"AgentID"`
}
// ----------------------------------------------------------------------------
type OptionID struct {
Text string `xml:",chardata"`
OptionID []string `xml:"OptionId"`
}
type SelectItem struct {
Text string `xml:",chardata"`
QuestionKey string `xml:"QuestionKey"`
OptionIDs *OptionID `xml:"OptionIds"`
}
type SelectItems struct {
Text string `xml:",chardata"`
SelectedItem []*SelectItem `xml:"SelectedItem"`
}
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 *SelectItems `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"`
}