-
Notifications
You must be signed in to change notification settings - Fork 174
/
client.go
33 lines (26 loc) · 896 Bytes
/
client.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
package dial
import (
"context"
"github.com/ArtisanCloud/PowerWeChat/v3/src/kernel"
"github.com/ArtisanCloud/PowerWeChat/v3/src/work/oa/dial/request"
"github.com/ArtisanCloud/PowerWeChat/v3/src/work/oa/dial/response"
)
type Client struct {
BaseClient *kernel.BaseClient
}
func NewClient(app kernel.ApplicationInterface) (*Client, error) {
baseClient, err := kernel.NewBaseClient(&app, nil)
if err != nil {
return nil, err
}
return &Client{
baseClient,
}, nil
}
// 获取公费电话拨打记录
// https://developer.work.weixin.qq.com/document/path/93662
func (comp *Client) GetDialRecord(ctx context.Context, options *request.RequestDialGetDialRecord) (*response.ResponseDialGetDialRecord, error) {
result := &response.ResponseDialGetDialRecord{}
_, err := comp.BaseClient.HttpPostJson(ctx, "cgi-bin/dial/get_dial_record", options, nil, nil, result)
return result, err
}