#1199 开放平台模块增加部分第三方平台代小程序实现业务的接口(包括查询服务商的当月提审限额和加急次数,加急审核申请)

* 🎨 统一异常输出

*  增加代小程序实现业务接口
This commit is contained in:
S
2019-09-12 09:31:26 +08:00
committed by Binary Wang
parent fdaefcb9ea
commit 6958142c47
5 changed files with 262 additions and 4 deletions

View File

@@ -196,6 +196,17 @@ public interface WxOpenMaService extends WxMaService {
String API_GET_GRAY_RELEASE_PLAN = "https://api.weixin.qq.com/wxa/getgrayreleaseplan";
/**
* 查询服务商的当月提审限额和加急次数Quota
*/
String API_QUERY_QUOTA = "https://api.weixin.qq.com/wxa/queryquota";
/**
* 加急审核申请
*/
String API_SPEED_AUDIT = "https://api.weixin.qq.com/wxa/speedupaudit";
/**
* 获得小程序的域名配置信息
*/
@@ -397,4 +408,17 @@ public interface WxOpenMaService extends WxMaService {
*/
WxOpenMaGrayReleasePlanResult getgrayreleaseplan() throws WxErrorException;
/**
* 查询服务商的当月提审限额和加急次数Quota
* https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/code/query_quota.html
*/
WxOpenMaQueryQuotaResult queryQuota() throws WxErrorException;
/**
* 加急审核申请
* 有加急次数的第三方可以通过该接口对已经提审的小程序进行加急操作加急后的小程序预计2-12小时内审完。
*/
Boolean speedAudit(Long auditid) throws WxErrorException;
}

View File

@@ -228,8 +228,7 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
*/
@Override
public WxOpenMaSearchStatusResult getWxaSearchStatus() throws WxErrorException {
JsonObject paramJson = new JsonObject();
String response = post(API_GET_WXA_SEARCH_STATUS, GSON.toJson(paramJson));
String response = get(API_GET_WXA_SEARCH_STATUS, null);
return WxMaGsonBuilder.create().fromJson(response, WxOpenMaSearchStatusResult.class);
}
@@ -523,6 +522,32 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
}
/**
* 查询服务商的当月提审限额和加急次数Quota
* https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/code/query_quota.html
*/
@Override
public WxOpenMaQueryQuotaResult queryQuota() throws WxErrorException {
String response = get(API_QUERY_QUOTA, null);
return WxMaGsonBuilder.create().fromJson(response, WxOpenMaQueryQuotaResult.class);
}
/**
* 加急审核申请
* 有加急次数的第三方可以通过该接口对已经提审的小程序进行加急操作加急后的小程序预计2-12小时内审完。
*/
@Override
public Boolean speedAudit(Long auditid) throws WxErrorException {
JsonObject params = new JsonObject();
params.addProperty("auditid", auditid);
String response = post(API_SPEED_AUDIT, GSON.toJson(params));
WxOpenResult result = WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class);
return result.isSuccess();
}
/**
* 将字符串对象转化为GsonArray对象
*

View File

@@ -0,0 +1,36 @@
package me.chanjar.weixin.open.bean.result;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import me.chanjar.weixin.open.util.json.WxOpenGsonBuilder;
/**
* 微信开放平台小程序当前分阶段发布详情
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class WxOpenMaQueryQuotaResult extends WxOpenResult {
private static final long serialVersionUID = 5915265985261653007L;
@SerializedName("rest")
private Integer rest;
@SerializedName("limit")
private Integer limit;
@SerializedName("speedup_rest")
private Integer speedupRest;
@SerializedName("speedup_limit")
private Integer speedupLimit;
@Override
public String toString() {
return WxOpenGsonBuilder.create().toJson(this);
}
}