-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 | ||
} |