From 7a4230414d4c5861e47bda8c6ef4dff796a3a798 Mon Sep 17 00:00:00 2001 From: silenceper Date: Sun, 24 May 2020 17:56:10 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=96=B0=E5=A2=9E=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3-=E6=B8=85=E7=90=86=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E6=AC=A1=E6=95=B0=202=E3=80=81fix=20?= =?UTF-8?q?=E5=A4=9A=E5=AE=A2=E6=9C=8D=E6=B6=88=E6=81=AF=E8=BD=AC=E5=8F=91?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- officialaccount/basic/basic.go | 19 +++++++++++++++++++ ...nsfer_customer.go => transfer_customer.go} | 0 2 files changed, 19 insertions(+) rename officialaccount/message/{ransfer_customer.go => transfer_customer.go} (100%) 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