diff --git a/officialaccount/basic/basic.go b/officialaccount/basic/basic.go index 52296b0..c0f02ba 100644 --- a/officialaccount/basic/basic.go +++ b/officialaccount/basic/basic.go @@ -12,6 +12,9 @@ var ( //文档:https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Get_the_WeChat_server_IP_address.html getCallbackIPURL = "https://api.weixin.qq.com/cgi-bin/getcallbackip" getAPIDomainIPURL = "https://api.weixin.qq.com/cgi-bin/get_api_domain_ip" + + //清理接口调用次数 + clearQuotaURL = "https://api.weixin.qq.com/cgi-bin/clear_quota" ) //Basic struct @@ -63,3 +66,19 @@ func (basic *Basic) GetAPIDomainIP() ([]string, error) { err = util.DecodeWithError(data, ipListRes, "GetAPIDomainIP") return ipListRes.IPList, err } + +//ClearQuota 清理接口调用次数 +func (basic *Basic) ClearQuota() error { + ak, err := basic.GetAccessToken() + if err != nil { + return err + } + url := fmt.Sprintf("%s?access_token=%s", clearQuotaURL, ak) + data, err := util.PostJSON(url, map[string]string{ + "appid": basic.AppID, + }) + if err != nil { + return err + } + return util.DecodeWithCommonError(data, "ClearQuota") +} diff --git a/officialaccount/message/ransfer_customer.go b/officialaccount/message/transfer_customer.go similarity index 100% rename from officialaccount/message/ransfer_customer.go rename to officialaccount/message/transfer_customer.go