新增 微信第三方平台 发布已通过审核的小程序接口

This commit is contained in:
Lemon
2023-08-01 11:01:18 +08:00
parent cb3ef2c242
commit c7359c981c
2 changed files with 42 additions and 0 deletions

View File

@@ -465,6 +465,28 @@ public class AgentDevService {
}
/**
* 发布已通过审核的小程序 调用本接口可以发布最后一个审核通过的小程序代码版本
* https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/code-management/release.html
* @return
*/
public String releaseProcedure(String authorizerAppid){
// 获取用户接口调用令牌
String redisKey = CacheConstants.AUTHORIZER_ACCESS_TOKEN + authorizerAppid;
String authAccessToken = redisCache.getCacheObject(redisKey);
if (StringUtils.isBlank(authAccessToken)) {
throw new RuntimeException("微信第三方平台 发布已通过审核的小程序 error: authAccessToken为空");
}
String url = "https://api.weixin.qq.com/wxa/release?access_token=" + authAccessToken;
JSONObject jsonObject = new JSONObject();
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
// 将返回结果转为json对象
JSONObject resultJson = JSONObject.parseObject(result);
// int errCode = (int) resultJson.get("errcode");
return resultJson.getString("errmsg");
}
public static void main(String[] args) {
JSONArray array = new JSONArray();