-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathkf.go
656 lines (604 loc) · 20.4 KB
/
kf.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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
package wework
import (
"github.com/go-laoji/wecom-go-sdk/v2/internal"
)
type KfAccount struct {
OpenKfId string `json:"open_kfid,omitempty"`
Name string `json:"name" validate:"required"`
MediaId string `json:"media_id" validate:"required"`
}
type KfAccountAddResponse struct {
internal.BizResponse
OpenKfId string `json:"open_kfid"`
}
func (ww *weWork) KfAccountAdd(corpId uint, account KfAccount) (resp KfAccountAddResponse) {
if ok := validate.Struct(account); ok != nil {
resp.ErrCode = 500
resp.ErrorMsg = ok.Error()
return
}
_, err := ww.getRequest(corpId).SetBody(account).SetResult(&resp).
Post("/cgi-bin/kf/account/add")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
func (ww *weWork) KfAccountDel(corpId uint, kfId string) (resp internal.BizResponse) {
if kfId == "" {
resp.ErrCode = 500
resp.ErrorMsg = "客服ID必填"
return
}
params := H{}
params["open_kfid"] = kfId
_, err := ww.getRequest(corpId).SetBody(params).SetResult(&resp).
Post("/cgi-bin/kf/account/del")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
func (ww *weWork) KfAccountUpdate(corpId uint, account KfAccount) (resp internal.BizResponse) {
if ok := validate.Struct(account); ok != nil {
resp.ErrCode = 500
resp.ErrorMsg = ok.Error()
return
}
_, err := ww.getRequest(corpId).SetBody(account).SetResult(&resp).
Post("/cgi-bin/kf/account/update")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type KfAccountListRequest struct {
Offset uint32 `json:"offset,omitempty"`
Limit uint32 `json:"limit,omitempty" validate:"max=100,min=1"`
}
type KfAccountListResponse struct {
internal.BizResponse
AccountList []struct {
OpenKfId string `json:"open_kfid"`
Name string `json:"name"`
Avatar string `json:"avatar"`
ManagePrivilege bool `json:"manage_privilege"`
} `json:"account_list"`
}
func (ww *weWork) KfAccountList(corpId uint, request KfAccountListRequest) (resp KfAccountListResponse) {
if ok := validate.Struct(request); ok != nil {
resp.ErrCode = 500
resp.ErrorMsg = ok.Error()
return
}
_, err := ww.getRequest(corpId).SetBody(request).SetResult(&resp).
Post("/cgi-bin/kf/account/list")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type KfAccContactWayResponse struct {
internal.BizResponse
Url string `json:"url"`
}
func (ww *weWork) KfAddContactWay(corpId uint, kfId string, scene string) (resp KfAccContactWayResponse) {
if kfId == "" {
resp.ErrCode = 500
resp.ErrorMsg = "客服ID必填"
return
}
params := H{}
params["open_kfid"] = kfId
params["scene"] = scene
_, err := ww.getRequest(corpId).SetBody(params).SetResult(&resp).
Post("/cgi-bin/kf/add_contact_way")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type KfServicerRequest struct {
OpenKfId string `json:"open_kfid" validate:"required"`
UserIdList []string `json:"userid_list" validate:"required_without=DepartmentIdList,max=100"`
DepartmentIdList []uint32 `json:"department_id_list" validate:"required_without=UserIdList,max=100"`
}
type KfServicerResponse struct {
internal.BizResponse
ResultList []struct {
UserId string `json:"userid,omitempty"`
DepartmentId uint32 `json:"department_id,omitempty"`
internal.BizResponse
} `json:"result_list"`
}
func (ww *weWork) KfServicerAdd(corpId uint, request KfServicerRequest) (resp KfServicerResponse) {
if ok := validate.Struct(request); ok != nil {
resp.ErrCode = 500
resp.ErrorMsg = ok.Error()
return
}
_, err := ww.getRequest(corpId).SetBody(request).SetResult(&resp).
Post("/cgi-bin/kf/servicer/add")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
func (ww *weWork) KfServicerDel(corpId uint, request KfServicerRequest) (resp KfServicerResponse) {
if ok := validate.Struct(request); ok != nil {
resp.ErrCode = 500
resp.ErrorMsg = ok.Error()
return
}
_, err := ww.getRequest(corpId).SetBody(request).SetResult(&resp).
Post("/cgi-bin/kf/servicer/del")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type KfServicerListResponse struct {
internal.BizResponse
ServicerList []struct {
UserId string `json:"userid,omitempty"`
Status uint `json:"status,omitempty"`
DepartmentId uint32 `json:"department_id,omitempty"`
} `json:"servicer_list"`
}
func (ww *weWork) KfServicerList(corpId uint, kfId string) (resp KfServicerListResponse) {
_, err := ww.getRequest(corpId).SetQueryParam("open_kf_id", kfId).SetResult(&resp).
Get("/cgi-bin/kf/servicer/list")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type KfServiceStateGetRequest struct {
OpenKfId string `json:"open_kfid" validate:"required"`
ExternalUserId string `json:"external_userid" validate:"required"`
}
type KfServiceStateGetResponse struct {
internal.BizResponse
ServiceState int `json:"service_state"`
ServicerUserId string `json:"servicer_userid"`
}
func (ww *weWork) KfServiceStateGet(corpId uint, request KfServiceStateGetRequest) (resp KfServiceStateGetResponse) {
if ok := validate.Struct(request); ok != nil {
resp.ErrCode = 500
resp.ErrorMsg = ok.Error()
return
}
_, err := ww.getRequest(corpId).SetBody(request).SetResult(&resp).
Post("/cgi-bin/kf/service_state/get")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type KfServiceStateTransRequest struct {
OpenKfId string `json:"open_kfid" validate:"required"`
ExternalUserId string `json:"external_userid" validate:"required"`
ServiceState int `json:"service_state" validate:"required,oneof=0 1 2 3 4"`
ServicerUserId string `json:"servicer_userid"`
}
type KfServiceStateTransResponse struct {
internal.BizResponse
MsgCode string `json:"msg_code"`
}
func (ww *weWork) KfServiceStateTrans(corpId uint, request KfServiceStateTransRequest) (resp KfServiceStateTransResponse) {
if ok := validate.Struct(request); ok != nil {
resp.ErrCode = 500
resp.ErrorMsg = ok.Error()
return
}
_, err := ww.getRequest(corpId).SetBody(request).SetResult(&resp).
Post("/cgi-bin/kf/service_state/trans")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type KfSyncMsgRequest struct {
Cursor string `json:"cursor"`
Token string `json:"token"`
Limit int `json:"limit"`
VoiceFormat int `json:"voice_format"`
OpenKfId string `json:"open_kfid"`
}
type KfMessage struct {
MsgId string `json:"msgid"`
OpenKfId string `json:"open_kfid"`
ExternalUserId string `json:"external_userid"`
SendTime int `json:"send_time"`
Origin int `json:"origin"`
ServicerUserId string `json:"servicer_userid"`
MsgType string `json:"msgtype"`
Text MsgText `json:"text,omitempty"`
Image MsgImage `json:"image,omitempty"`
Voice MsgVoice `json:"voice,omitempty"`
Video MsgVideo `json:"video,omitempty"`
File MsgFile `json:"file,omitempty"`
Location MsgLocation `json:"location,omitempty"`
Link MsgLink `json:"link,omitempty"`
BusinessCard MsgBusinessCard `json:"business_card,omitempty"`
MiniProgram MsgMiniProgram `json:"miniprogram,omitempty"`
MsgMenu MsgMenu `json:"msgmenu,omitempty"`
ChannelsShopProduct MsgChannelsShopProduct `json:"channels_shop_product,omitempty"`
ChannelsShopOrder MsgChannelsShopOrder `json:"channels_shop_order,omitempty"`
Event MsgEvent `json:"event,omitempty"`
}
type KfSyncMsgResponse struct {
internal.BizResponse
NextCursor string `json:"next_cursor"`
HasMore int `json:"has_more"`
MsgList []KfMessage `json:"msg_list"`
}
type MsgText struct {
Content string `json:"content"`
MenuId string `json:"menu_id"`
}
type MsgImage struct {
MediaId string `json:"media_id"`
}
type MsgVoice struct {
MediaId string `json:"media_id"`
}
type MsgVideo struct {
MediaId string `json:"media_id"`
}
type MsgFile struct {
MediaId string `json:"media_id"`
}
type MsgLocation struct {
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
Name string `json:"name"`
Address string `json:"address"`
}
type MsgLink struct {
Title string `json:"title"`
Desc string `json:"desc"`
Url string `json:"url"`
ThumbMediaId string `json:"thumb_media_id"`
}
type MsgBusinessCard struct {
UserId string `json:"userid"`
}
type MsgMiniProgram struct {
Title string `json:"title"`
AppId string `json:"appid"`
PagePath string `json:"pagepath"`
ThumbMediaId string `json:"thumb_media_id"`
}
type MenuItemClick struct {
ID string `json:"id"`
Content string `json:"content"`
}
type MenuItemView struct {
URL string `json:"url"`
Content string `json:"content"`
}
type MenuItemMiniProgram struct {
Appid string `json:"appid"`
PagePath string `json:"pagepath"`
Content string `json:"content"`
}
type MenuItemText struct {
Content string `json:"content"`
NoNewLine int `json:"no_newline,omitempty"`
TailContent *string `json:"tail_content,omitempty"`
}
type MenuItem struct {
Type string `json:"type"`
Click *MenuItemClick `json:"click,omitempty"`
View *MenuItemView `json:"view,omitempty"`
MiniProgram *MenuItemMiniProgram `json:"miniprogram,omitempty"`
Text *MenuItemText `json:"text,omitempty"`
}
type MsgMenu struct {
HeadContent string `json:"head_content"`
List []MenuItem `json:"list"`
TailContent string `json:"tail_content"`
}
type MsgCaLink struct {
LinkUrl string `json:"link_url"`
}
type MsgChannelsShopProduct struct {
ProductID string `json:"product_id"`
HeadImg string `json:"head_img"`
Title string `json:"title"`
SalesPrice string `json:"sales_price"`
ShopNickname string `json:"shop_nickname"`
ShopHeadImg string `json:"shop_head_img"`
}
type MsgChannelsShopOrder struct {
OrderID string `json:"order_id"`
ProductTitles string `json:"product_titles"`
PriceWording string `json:"price_wording"`
State string `json:"state"`
ImageURL string `json:"image_url"`
ShopNickname string `json:"shop_nickname"`
}
type MsgEvent struct {
EventType string `json:"event_type"`
OpenKfid string `json:"open_kfid"`
ExternalUserid string `json:"external_userid"`
Scene string `json:"scene"`
SceneParam string `json:"scene_param"`
WelcomeCode string `json:"welcome_code"`
WechatChannels struct {
Nickname string `json:"nickname"`
ShopNickName string `json:"shop_nickname"`
Scene uint32 `json:"scene"`
} `json:"wechat_channels"`
}
func (ww *weWork) KfSyncMsg(corpId uint, request KfSyncMsgRequest) (resp KfSyncMsgResponse) {
if ok := validate.Struct(request); ok != nil {
resp.ErrCode = 500
resp.ErrorMsg = ok.Error()
return
}
_, err := ww.getRequest(corpId).SetBody(request).SetResult(&resp).
Post("/cgi-bin/kf/sync_msg")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type SendMsgRequest struct {
ToUser string `json:"touser" validate:"required"`
OpenKfId string `json:"open_kfid" validate:"required"`
MsgId string `json:"msgid,omitempty"`
MsgType string `json:"msgtype" validate:"required"`
Text *MsgText `json:"text,omitempty"`
Image *MsgImage `json:"image,omitempty"`
Voice *MsgVoice `json:"voice,omitempty"`
Video *MsgVideo `json:"video,omitempty"`
File *MsgFile `json:"file,omitempty"`
Location *MsgLocation `json:"location,omitempty"`
Link *MsgLink `json:"link,omitempty"`
MiniProgram *MsgMiniProgram `json:"miniprogram,omitempty"`
MsgMenu *MsgMenu `json:"msgmenu,omitempty"`
CaLink *MsgCaLink `json:"ca_link,omitempty"`
}
type SendMsgResponse struct {
internal.BizResponse
MsgId string `json:"msgid"`
}
func (ww *weWork) KfSendMsg(corpId uint, request SendMsgRequest) (resp SendMsgResponse) {
if ok := validate.Struct(request); ok != nil {
resp.ErrCode = 500
resp.ErrorMsg = ok.Error()
return
}
_, err := ww.getRequest(corpId).SetBody(request).SetResult(&resp).
Post("/cgi-bin/kf/send_msg")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type SendMsgOnEventRequest struct {
Code string `json:"code" validate:"required"`
MsgId string `json:"msgid,omitempty"`
MsgType string `json:"msgtype" validate:"required,oneof=text msgmenu"`
Text *MsgText `json:"text,omitempty"`
MsgMenu *MsgMenu `json:"msgmenu,omitempty"`
}
func (ww *weWork) KfSendMsgOnEvent(corpId uint, request SendMsgOnEventRequest) (resp SendMsgResponse) {
if ok := validate.Struct(request); ok != nil {
resp.ErrCode = 500
resp.ErrorMsg = ok.Error()
return
}
_, err := ww.getRequest(corpId).SetBody(request).SetResult(&resp).
Post("/cgi-bin/kf/send_msg_on_event")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type KfCustomerBatchGetResponse struct {
internal.BizResponse
CustomerList []struct {
ExternalUserid string `json:"external_userid"`
Nickname string `json:"nickname"`
Avatar string `json:"avatar"`
Gender int `json:"gender"`
Unionid string `json:"unionid"`
EnterSessionContext struct {
Scene string `json:"scene"`
SceneParam string `json:"scene_param"`
WechatChannels struct {
Nickname string `json:"nickname"`
ShopNickName string `json:"shop_nickname"`
Scene uint32 `json:"scene"`
} `json:"wechat_channels"`
} `json:"enter_session_context"`
} `json:"customer_list"`
InvalidExternalUserid []string `json:"invalid_external_userid"`
}
func (ww *weWork) KfCustomerBatchGet(corpId uint, userList []string, needEnterSessionContext int) (resp KfCustomerBatchGetResponse) {
params := H{}
if needEnterSessionContext == 1 {
params["need_enter_session_context"] = 1
}
params["external_userid_list"] = userList
_, err := ww.getRequest(corpId).SetBody(params).SetResult(&resp).
Post("/cgi-bin/kf/customer/batchget")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type KfGetCorpQualificationResponse struct {
internal.BizResponse
WeChatChannelsBinding bool `json:"wechat_channels_binding"`
}
// KfGetCorpQualification 仅支持第三方应用,且需具有“微信客服->获取基础信息”权限
func (ww *weWork) KfGetCorpQualification(corpId uint) (resp KfGetCorpQualificationResponse) {
_, err := ww.getRequest(corpId).SetResult(&resp).
Get("/cgi-bin/kf/get_corp_qualification")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type KfGetUpgradeServiceConfigResponse struct {
internal.BizResponse
MemberRange struct {
UseridList []string `json:"userid_list"`
DepartmentIDList []int `json:"department_id_list"`
} `json:"member_range"`
GroupchatRange struct {
ChatIDList []string `json:"chat_id_list"`
} `json:"groupchat_range"`
}
func (ww *weWork) KfGetUpgradeServiceConfig(corpId uint) (resp KfGetUpgradeServiceConfigResponse) {
_, err := ww.getRequest(corpId).SetResult(&resp).
Get("/cgi-bin/kf/customer/get_upgrade_service_config")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type UpgradeServiceRequest struct {
OpenKfId string `json:"open_kfid" validate:"required"`
ExternalUserId string `json:"external_userid" validate:"required"`
Type int `json:"type" validate:"required,oneof=1 2"`
Member *UpgradeServiceMember `json:"member,omitempty"`
GroupChat *UpgradeServiceGroupChat `json:"groupchat,omitempty"`
}
type UpgradeServiceMember struct {
UserId string `json:"userid" validate:"required"`
Wording string `json:"wording"`
}
type UpgradeServiceGroupChat struct {
ChatId string `json:"chat_id" validate:"required"`
Wording string `json:"wording"`
}
func (ww *weWork) KfUpgradeService(corpId uint, request UpgradeServiceRequest) (resp internal.BizResponse) {
if ok := validate.Struct(request); ok != nil {
resp.ErrCode = 500
resp.ErrorMsg = ok.Error()
return
}
_, err := ww.getRequest(corpId).SetBody(request).SetResult(&resp).
Post("/cgi-bin/kf/customer/upgrade_service")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type CancelUpgradeServiceRequest struct {
OpenKfId string `json:"open_kfid" validate:"required"`
ExternalUserId string `json:"external_userid" validate::"required"`
}
func (ww *weWork) KfCancelUpgradeService(corpId uint, request CancelUpgradeServiceRequest) (resp internal.BizResponse) {
if ok := validate.Struct(request); ok != nil {
resp.ErrCode = 500
resp.ErrorMsg = ok.Error()
return
}
_, err := ww.getRequest(corpId).SetBody(request).SetResult(&resp).
Post("/cgi-bin/kf/customer/cancel_upgrade_service")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type KfGetCorpStatisticFilter struct {
OpenKfId string `json:"open_kfid,omitempty"`
StartTime uint32 `json:"start_time" validate:"required"`
EndTime uint32 `json:"end_time" validate:"required"`
}
type KfGetCorpStatisticResponse struct {
internal.BizResponse
StatisticList []struct {
StatTime int `json:"stat_time"`
Statistic struct {
SessionCnt int `json:"session_cnt"`
CustomerCnt int `json:"customer_cnt"`
CustomerMsgCnt int `json:"customer_msg_cnt"`
UpgradeServiceCustomerCnt int `json:"upgrade_service_customer_cnt"`
AiSessionReplyCnt int `json:"ai_session_reply_cnt"`
AiTransferRate int `json:"ai_transfer_rate"`
AiKnowledgeHitRate int `json:"ai_knowledge_hit_rate"`
} `json:"statistic"`
} `json:"statistic_list"`
}
func (ww *weWork) KfGetCorpStatistic(corpId uint, filter KfGetCorpStatisticFilter) (resp KfGetCorpStatisticResponse) {
if ok := validate.Struct(filter); ok != nil {
resp.ErrCode = 500
resp.ErrorMsg = ok.Error()
return
}
_, err := ww.getRequest(corpId).SetBody(filter).SetResult(&resp).
Post("/cgi-bin/kf/get_corp_statistic")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}
type KfGetServicerStatisticFilter struct {
OpenKfId string `json:"open_kfid,omitempty"`
ServicerUserId string `json:"servicer_userid,omitempty"`
StartTime uint32 `json:"start_time" validate:"required"`
EndTime uint32 `json:"end_time" validate:"required"`
}
type KfGetServicerStatisticResponse struct {
internal.BizResponse
StatisticList []struct {
StatTime int `json:"stat_time"`
Statistic struct {
SessionCnt int `json:"session_cnt"`
CustomerCnt int `json:"customer_cnt"`
CustomerMsgCnt int `json:"customer_msg_cnt"`
ReplyRate int `json:"reply_rate"`
FirstReplyAverageSec int `json:"first_reply_average_sec"`
SatisfactionInvestgateCnt int `json:"satisfaction_investgate_cnt"`
SatisfactionParticipationRate int `json:"satisfaction_participation_rate"`
SatisfiedRate int `json:"satisfied_rate"`
MiddlingRate int `json:"middling_rate"`
DissatisfiedRate int `json:"dissatisfied_rate"`
UpgradeServiceCustomerCnt int `json:"upgrade_service_customer_cnt"`
UpgradeServiceMemberInviteCnt int `json:"upgrade_service_member_invite_cnt"`
UpgradeServiceMemberCustomerCnt int `json:"upgrade_service_member_customer_cnt"`
UpgradeServiceGroupchatInviteCnt int `json:"upgrade_service_groupchat_invite_cnt"`
UpgradeServiceGroupchatCustomerCnt int `json:"upgrade_service_groupchat_customer_cnt"`
} `json:"statistic"`
} `json:"statistic_list"`
}
func (ww *weWork) KfGetServicerStatistic(corpId uint, filter KfGetServicerStatisticFilter) (resp KfGetServicerStatisticResponse) {
if ok := validate.Struct(filter); ok != nil {
resp.ErrCode = 500
resp.ErrorMsg = ok.Error()
return
}
_, err := ww.getRequest(corpId).SetBody(filter).SetResult(&resp).
Post("/cgi-bin/kf/get_servicer_statistic")
if err != nil {
resp.ErrCode = 500
resp.ErrorMsg = err.Error()
}
return
}