/
open_api_data.go
36 lines (31 loc) · 1023 Bytes
/
open_api_data.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
package dingtalk
type DataRecordResponse struct {
OpenAPIResponse
ID string `json:"id"`
}
type DataRequest struct {
ID string `json:"id,omitempty"`
StartTimeMs string `json:"startTimeMs"`
EndTimeMs string `json:"endTimeMs"`
Module string `json:"module,omitempty"`
OriginID string `json:"originId,omitempty"`
UserID string `json:"userid"`
AgentID string `json:"agentId"`
CallbackUrl string `json:"callbackUrl"`
Extension interface{} `json:"extension,omitempty"`
}
type DataUpdateResponse struct {
OpenAPIResponse
}
// 记录统计数据
func (dtc *DingTalkClient) DataRecord(info *DataRequest) (DataRecordResponse, error) {
var data DataRecordResponse
err := dtc.httpRPC("data/record", nil, info, &data)
return data, err
}
// 更新统计数据
func (dtc *DingTalkClient) DataUpdate(info *DataRequest) (DataUpdateResponse, error) {
var data DataUpdateResponse
err := dtc.httpRPC("data/update", nil, info, &data)
return data, err
}