增加实现开放小程序的设置支持版本库接口;增加WxOpenResult开放平台返回类型并修改相关接口实现。

This commit is contained in:
袁启勋
2018-10-14 15:01:51 +08:00
parent aa106de6ce
commit bb9768a517
9 changed files with 132 additions and 50 deletions

View File

@@ -219,7 +219,7 @@ public interface WxOpenMaService extends WxMaService {
* @return
* @throws WxErrorException
*/
String bindTester(String wechatid) throws WxErrorException;
WxOpenResult bindTester(String wechatid) throws WxErrorException;
/**
* 解除绑定小程序体验者
@@ -228,7 +228,7 @@ public interface WxOpenMaService extends WxMaService {
* @return
* @throws WxErrorException
*/
String unbindTester(String wechatid) throws WxErrorException;
WxOpenResult unbindTester(String wechatid) throws WxErrorException;
/**
* 获得体验者列表
@@ -248,7 +248,7 @@ public interface WxOpenMaService extends WxMaService {
* @return
* @throws WxErrorException
*/
String codeCommit(Long templateId, String userVersion, String userDesc, WxMaOpenCommitExtInfo extInfo) throws WxErrorException;
WxOpenResult codeCommit(Long templateId, String userVersion, String userDesc, WxMaOpenCommitExtInfo extInfo) throws WxErrorException;
/**
* 获取体验小程序的体验二维码
@@ -294,7 +294,7 @@ public interface WxOpenMaService extends WxMaService {
* @return
* @throws WxErrorException
*/
String getAuditStatus(Long auditid) throws WxErrorException;
WxOpenMaQueryAuditResult getAuditStatus(Long auditid) throws WxErrorException;
/**
* 查询最新一次提交的审核状态(仅供第三方代小程序调用)
@@ -302,7 +302,7 @@ public interface WxOpenMaService extends WxMaService {
* @return
* @throws WxErrorException
*/
String getLatestAuditStatus() throws WxErrorException;
WxOpenMaQueryAuditResult getLatestAuditStatus() throws WxErrorException;
/**
* 发布已通过审核的小程序(仅供第三方代小程序调用)
@@ -310,7 +310,7 @@ public interface WxOpenMaService extends WxMaService {
* @return
* @throws WxErrorException
*/
String releaesAudited() throws WxErrorException;
WxOpenResult releaesAudited() throws WxErrorException;
/**
* 11. 小程序版本回退(仅供第三方代小程序调用)
@@ -318,7 +318,7 @@ public interface WxOpenMaService extends WxMaService {
* @return
* @throws WxErrorException
*/
String revertCodeReleaes() throws WxErrorException;
WxOpenResult revertCodeReleaes() throws WxErrorException;
/**
* 15. 小程序审核撤回
@@ -329,6 +329,21 @@ public interface WxOpenMaService extends WxMaService {
* @return
* @throws WxErrorException
*/
String undoCodeAudit() throws WxErrorException;
WxOpenResult undoCodeAudit() throws WxErrorException;
/**
* 查询当前设置的最低基础库版本及各版本用户占比 (仅供第三方代小程序调用)
* @return
* @throws WxErrorException
*/
String getSupportVersion() throws WxErrorException;
/**
* 设置最低基础库版本(仅供第三方代小程序调用)
* @param version
* @return
* @throws WxErrorException
*/
String setSupportVersion(String version) throws WxErrorException;
}

View File

@@ -146,11 +146,11 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
* @throws WxErrorException
*/
@Override
public String bindTester(String wechatid) throws WxErrorException {
public WxOpenResult bindTester(String wechatid) throws WxErrorException {
JsonObject paramJson = new JsonObject();
paramJson.addProperty("wechatid", wechatid);
String response = post(API_BIND_TESTER, GSON.toJson(paramJson));
return response;
return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class);
}
/**
@@ -161,11 +161,11 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
* @throws WxErrorException
*/
@Override
public String unbindTester(String wechatid) throws WxErrorException {
public WxOpenResult unbindTester(String wechatid) throws WxErrorException {
JsonObject paramJson = new JsonObject();
paramJson.addProperty("wechatid", wechatid);
String response = post(API_UNBIND_TESTER, GSON.toJson(paramJson));
return response;
return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class);
}
/**
@@ -193,7 +193,7 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
* @throws WxErrorException
*/
@Override
public String codeCommit(Long templateId, String userVersion, String userDesc, WxMaOpenCommitExtInfo extInfo) throws WxErrorException {
public WxOpenResult codeCommit(Long templateId, String userVersion, String userDesc, WxMaOpenCommitExtInfo extInfo) throws WxErrorException {
JsonObject params = new JsonObject();
params.addProperty("template_id", templateId);
params.addProperty("user_version", userVersion);
@@ -201,7 +201,7 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
//注意ext_json必须是字符串类型
params.addProperty("ext_json", GSON.toJson(extInfo));
String response = post(API_CODE_COMMIT, GSON.toJson(params));
return response;
return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class);
}
/**
@@ -265,11 +265,11 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
* @throws WxErrorException
*/
@Override
public String getAuditStatus(Long auditid) throws WxErrorException {
public WxOpenMaQueryAuditResult getAuditStatus(Long auditid) throws WxErrorException {
JsonObject params = new JsonObject();
params.addProperty("auditid", auditid);
String response = post(API_GET_AUDIT_STATUS, GSON.toJson(params));
return response;
return WxMaGsonBuilder.create().fromJson(response, WxOpenMaQueryAuditResult.class);
}
/**
@@ -279,9 +279,9 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
* @throws WxErrorException
*/
@Override
public String getLatestAuditStatus() throws WxErrorException {
public WxOpenMaQueryAuditResult getLatestAuditStatus() throws WxErrorException {
String response = get(API_GET_LATEST_AUDIT_STATUS, null);
return response;
return WxMaGsonBuilder.create().fromJson(response, WxOpenMaQueryAuditResult.class);
}
/**
@@ -294,10 +294,10 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
* @throws WxErrorException
*/
@Override
public String releaesAudited() throws WxErrorException {
public WxOpenResult releaesAudited() throws WxErrorException {
JsonObject params = new JsonObject();
String response = post(API_RELEASE, GSON.toJson(params));
return response;
return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class);
}
/**
@@ -307,9 +307,9 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
* @throws WxErrorException
*/
@Override
public String revertCodeReleaes() throws WxErrorException {
public WxOpenResult revertCodeReleaes() throws WxErrorException {
String response = get(API_REVERT_CODE_RELEASE, null);
return response;
return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class);
}
/**
@@ -322,8 +322,36 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
* @throws WxErrorException
*/
@Override
public String undoCodeAudit() throws WxErrorException {
public WxOpenResult undoCodeAudit() throws WxErrorException {
String response = get(API_UNDO_CODE_AUDIT, null);
return WxMaGsonBuilder.create().fromJson(response, WxOpenResult.class);
}
/**
* 查询当前设置的最低基础库版本及各版本用户占比 (仅供第三方代小程序调用)
*
* @return
* @throws WxErrorException
*/
@Override
public String getSupportVersion() throws WxErrorException {
JsonObject params = new JsonObject();
String response = post(API_GET_WEAPP_SUPPORT_VERSION, GSON.toJson(params));
return response;
}
/**
* 设置最低基础库版本(仅供第三方代小程序调用)
*
* @param version
* @return
* @throws WxErrorException
*/
@Override
public String setSupportVersion(String version) throws WxErrorException {
JsonObject params = new JsonObject();
params.addProperty("version", version);
String response = post(API_SET_WEAPP_SUPPORT_VERSION, GSON.toJson(params));
return response;
}