mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-10 07:42:26 +08:00
@@ -12,6 +12,9 @@ var (
|
|||||||
//文档:https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Get_the_WeChat_server_IP_address.html
|
//文档: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"
|
getCallbackIPURL = "https://api.weixin.qq.com/cgi-bin/getcallbackip"
|
||||||
getAPIDomainIPURL = "https://api.weixin.qq.com/cgi-bin/get_api_domain_ip"
|
getAPIDomainIPURL = "https://api.weixin.qq.com/cgi-bin/get_api_domain_ip"
|
||||||
|
|
||||||
|
//清理接口调用次数
|
||||||
|
clearQuotaURL = "https://api.weixin.qq.com/cgi-bin/clear_quota"
|
||||||
)
|
)
|
||||||
|
|
||||||
//Basic struct
|
//Basic struct
|
||||||
@@ -63,3 +66,19 @@ func (basic *Basic) GetAPIDomainIP() ([]string, error) {
|
|||||||
err = util.DecodeWithError(data, ipListRes, "GetAPIDomainIP")
|
err = util.DecodeWithError(data, ipListRes, "GetAPIDomainIP")
|
||||||
return ipListRes.IPList, err
|
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")
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user