mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-12-12 20:20:08 +08:00
🆕 #2856 【企业微信】增加获取应用二维码的接口;【开放平台】增加使用 AppSecret 重置第三方平台 API 调用次数的接口
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user