🆕 #2856 【企业微信】增加获取应用二维码的接口;【开放平台】增加使用 AppSecret 重置第三方平台 API 调用次数的接口

This commit is contained in:
Nobody
2022-10-30 14:19:26 +08:00
committed by GitHub
parent 46921e0e55
commit edb098500d
9 changed files with 155 additions and 0 deletions

View File

@@ -200,6 +200,7 @@ public interface WxOpenComponentService {
String BATCH_SHARE_ENV = "https://api.weixin.qq.com/componenttcb/batchshareenv";
String COMPONENT_CLEAR_QUOTA_URL = "https://api.weixin.qq.com/cgi-bin/component/clear_quota/v2";
/**
* Gets wx mp service by appid.
*
@@ -1085,4 +1086,15 @@ public interface WxOpenComponentService {
* @throws WxErrorException
*/
ShareCloudBaseEnvResponse shareCloudBaseEnv(ShareCloudBaseEnvRequest request) throws WxErrorException;
/**
* 使用 AppSecret 重置第三方平台 API 调用次数
* https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/openapi/clearComponentQuotaByAppSecret.html
*
* @param appid 授权用户appid
* @return
* @throws WxErrorException
*/
WxOpenResult clearQuotaV2(String appid) throws WxErrorException;
}

View File

@@ -1265,4 +1265,14 @@ public class WxOpenComponentServiceImpl implements WxOpenComponentService {
String response = post(BATCH_SHARE_ENV, gson.toJson(request));
return WxOpenGsonBuilder.create().fromJson(response, ShareCloudBaseEnvResponse.class);
}
@Override
public WxOpenResult clearQuotaV2(String appid) throws WxErrorException {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("appid", appid);
jsonObject.addProperty("component_appid", getWxOpenConfigStorage().getComponentAppId());
jsonObject.addProperty("appsecret", getWxOpenConfigStorage().getComponentAppSecret());
String response = getWxOpenService().post(COMPONENT_CLEAR_QUOTA_URL, jsonObject.toString());
return WxOpenResult.fromJson(response);
}
}