-
Notifications
You must be signed in to change notification settings - Fork 7
/
留资组件-按时间获取留资信息详情 .go
executable file
·56 lines (47 loc) · 1.46 KB
/
留资组件-按时间获取留资信息详情 .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
package apis
import (
"encoding/json"
)
// 获取留资request_id列表详情
// 文档:https://developers.weixin.qq.com/doc/channels/API/leads/get_leads_request_id.html
type ReqGetLeadsInfoByComponentId struct {
LeadsComponentId string `json:"leads_component_id"`
StartTime int `json:"start_time"`
EndTime int `json:"end_time"`
LastBuffer string `json:"last_buffer"`
}
var _ bodyer = ReqGetLeadsInfoByComponentId{}
func (x ReqGetLeadsInfoByComponentId) intoBody() ([]byte, error) {
result, err := json.Marshal(x)
if err != nil {
return nil, err
}
return result, nil
}
type RespGetLeadsInfoByComponentId struct {
CommonResp
UserData []struct {
Phone string `json:"phone"`
} `json:"user_data"`
LastBuffer string `json:"last_buffer"`
ContinueFlag bool `json:"continue_flag"`
}
var _ bodyer = RespGetLeadsInfoByComponentId{}
func (x RespGetLeadsInfoByComponentId) intoBody() ([]byte, error) {
result, err := json.Marshal(x)
if err != nil {
return nil, err
}
return result, nil
}
func (c *ApiClient) ExecGetLeadsInfoByComponentId(req ReqGetLeadsInfoByComponentId) (RespGetLeadsInfoByComponentId, error) {
var resp RespGetLeadsInfoByComponentId
err := c.executeWXApiPost("/channels/leads/get_leads_info_by_component_id", req, &resp, true)
if err != nil {
return RespGetLeadsInfoByComponentId{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return RespGetLeadsInfoByComponentId{}, bizErr
}
return resp, nil
}