🆕 #3739 【开放平台】补充完善第三方平台小程序快速配置域名的相关接口
This commit is contained in:
@@ -203,6 +203,21 @@ public interface WxOpenComponentService {
|
|||||||
|
|
||||||
String COMPONENT_CLEAR_QUOTA_URL = "https://api.weixin.qq.com/cgi-bin/component/clear_quota/v2";
|
String COMPONENT_CLEAR_QUOTA_URL = "https://api.weixin.qq.com/cgi-bin/component/clear_quota/v2";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置第三方平台服务器域名
|
||||||
|
*/
|
||||||
|
String API_MODIFY_WXA_SERVER_DOMAIN = "https://api.weixin.qq.com/cgi-bin/component/modify_wxa_server_domain";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取第三方平台业务域名校验文件
|
||||||
|
*/
|
||||||
|
String API_GET_DOMAIN_CONFIRM_FILE = "https://api.weixin.qq.com/cgi-bin/component/get_domain_confirmfile";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置第三方平台业务域名
|
||||||
|
*/
|
||||||
|
String API_MODIFY_WXA_JUMP_DOMAIN = "https://api.weixin.qq.com/cgi-bin/component/modify_wxa_jump_domain";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets wx mp service by appid.
|
* Gets wx mp service by appid.
|
||||||
*
|
*
|
||||||
@@ -1117,4 +1132,53 @@ public interface WxOpenComponentService {
|
|||||||
*/
|
*/
|
||||||
WxOpenResult applySetOrderPathInfo(WxOpenMaApplyOrderPathInfo info) throws WxErrorException;
|
WxOpenResult applySetOrderPathInfo(WxOpenMaApplyOrderPathInfo info) throws WxErrorException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置第三方平台服务器域名
|
||||||
|
* <a href="https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/ThirdParty/domain/modify_server_domain.html">文档地址</a>
|
||||||
|
*
|
||||||
|
* @param action add添加, delete删除, set覆盖, get获取
|
||||||
|
* @param requestDomains request 合法域名;当 action 是 get 时不需要此字段
|
||||||
|
* @param wsRequestDomains socket 合法域名;当 action 是 get 时不需要此字段
|
||||||
|
* @param uploadDomains uploadFile 合法域名;当 action 是 get 时不需要此字段
|
||||||
|
* @param downloadDomains downloadFile 合法域名;当 action 是 get 时不需要此字段
|
||||||
|
* @param tcpDomains tcp 合法域名;当 action 是 get 时不需要此字段
|
||||||
|
* @param udpDomains udp 合法域名;当 action 是 get 时不需要此字段
|
||||||
|
* @return the wx open ma domain result
|
||||||
|
* @throws WxErrorException the wx error exception
|
||||||
|
*/
|
||||||
|
WxOpenMaDomainResult modifyWxaServerDomain(String action, List<String> requestDomains, List<String> wsRequestDomains,
|
||||||
|
List<String> uploadDomains, List<String> downloadDomains,
|
||||||
|
List<String> udpDomains, List<String> tcpDomains) throws WxErrorException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取第三方平台业务域名校验文件
|
||||||
|
* <a href="https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/ThirdParty/domain/get_domain_confirmfile.html">文档地址</a>
|
||||||
|
*
|
||||||
|
* @return 业务域名校验文件信息
|
||||||
|
* @throws WxErrorException 操作失败时抛出,具体错误码请看文档
|
||||||
|
*/
|
||||||
|
WxOpenMaDomainConfirmFileResult getDomainConfirmFile() throws WxErrorException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置第三方平台业务域名
|
||||||
|
* <a href="https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/ThirdParty/domain/modify_jump_domain.html">文档地址</a>
|
||||||
|
*
|
||||||
|
* @param action add添加, delete删除, set覆盖, get获取
|
||||||
|
* @param domainList the domain list
|
||||||
|
* @return 直接返回字符串
|
||||||
|
* @throws WxErrorException the wx error exception
|
||||||
|
*/
|
||||||
|
String modifyWxaJumpDomain(String action, List<String> domainList) throws WxErrorException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置第三方平台业务域名
|
||||||
|
* <a href="https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/ThirdParty/domain/modify_jump_domain.html">文档地址</a>
|
||||||
|
*
|
||||||
|
* @param action add添加, delete删除, set覆盖, get获取
|
||||||
|
* @param domainList the domain list
|
||||||
|
* @return web view domain info
|
||||||
|
* @throws WxErrorException the wx error exception
|
||||||
|
*/
|
||||||
|
WxOpenMaWebDomainResult modifyWxaJumpDomainInfo(String action, List<String> domainList) throws WxErrorException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ public interface WxOpenMaService extends WxMaService {
|
|||||||
*/
|
*/
|
||||||
String API_MODIFY_DOMAIN = "https://api.weixin.qq.com/wxa/modify_domain";
|
String API_MODIFY_DOMAIN = "https://api.weixin.qq.com/wxa/modify_domain";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 快速配置小程序服务器域名
|
||||||
|
*/
|
||||||
|
String API_MODIFY_DOMAIN_DIRECTLY = "https://api.weixin.qq.com/wxa/modify_domain_directly";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置小程序业务域名(仅供第三方代小程序调用)
|
* 设置小程序业务域名(仅供第三方代小程序调用)
|
||||||
* <pre>
|
* <pre>
|
||||||
@@ -44,6 +49,11 @@ public interface WxOpenMaService extends WxMaService {
|
|||||||
*/
|
*/
|
||||||
String API_SET_WEBVIEW_DOMAIN = "https://api.weixin.qq.com/wxa/setwebviewdomain";
|
String API_SET_WEBVIEW_DOMAIN = "https://api.weixin.qq.com/wxa/setwebviewdomain";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 快速配置小程序业务域名
|
||||||
|
*/
|
||||||
|
String API_SET_WEBVIEW_DOMAIN_DIRECTLY = "https://api.weixin.qq.com/wxa/setwebviewdomain_directly";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取业务域名校验文件(仅供第三方代小程序调用)
|
* 获取业务域名校验文件(仅供第三方代小程序调用)
|
||||||
*/
|
*/
|
||||||
@@ -310,6 +320,24 @@ public interface WxOpenMaService extends WxMaService {
|
|||||||
List<String> uploadDomains, List<String> downloadDomains,
|
List<String> uploadDomains, List<String> downloadDomains,
|
||||||
List<String> udpDomains, List<String> tcpDomains) throws WxErrorException;
|
List<String> udpDomains, List<String> tcpDomains) throws WxErrorException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 快速配置小程序服务器域名
|
||||||
|
* <a href="https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Mini_Program_Basic_Info/modify_domain_directly.html">文档地址</a>
|
||||||
|
*
|
||||||
|
* @param action add添加, delete删除, set覆盖, get获取
|
||||||
|
* @param requestDomains request 合法域名;当 action 是 get 时不需要此字段
|
||||||
|
* @param wsRequestDomains socket 合法域名;当 action 是 get 时不需要此字段
|
||||||
|
* @param uploadDomains uploadFile 合法域名;当 action 是 get 时不需要此字段
|
||||||
|
* @param downloadDomains downloadFile 合法域名;当 action 是 get 时不需要此字段
|
||||||
|
* @param tcpDomains tcp 合法域名;当 action 是 get 时不需要此字段
|
||||||
|
* @param udpDomains udp 合法域名;当 action 是 get 时不需要此字段
|
||||||
|
* @return the wx open ma domain result
|
||||||
|
* @throws WxErrorException the wx error exception
|
||||||
|
*/
|
||||||
|
WxOpenMaDomainResult modifyDomainDirectly(String action, List<String> requestDomains, List<String> wsRequestDomains,
|
||||||
|
List<String> uploadDomains, List<String> downloadDomains,
|
||||||
|
List<String> udpDomains, List<String> tcpDomains) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取小程序的业务域名
|
* 获取小程序的业务域名
|
||||||
*
|
*
|
||||||
@@ -346,6 +374,28 @@ public interface WxOpenMaService extends WxMaService {
|
|||||||
*/
|
*/
|
||||||
WxOpenMaWebDomainResult setWebViewDomainInfo(String action, List<String> domainList) throws WxErrorException;
|
WxOpenMaWebDomainResult setWebViewDomainInfo(String action, List<String> domainList) throws WxErrorException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 快速配置小程序业务域名
|
||||||
|
* <a href="https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Mini_Program_Basic_Info/setwebviewdomain_directly.html">文档地址</a>
|
||||||
|
*
|
||||||
|
* @param action add添加, delete删除, set覆盖, get获取
|
||||||
|
* @param domainList the domain list
|
||||||
|
* @return 直接返回字符串
|
||||||
|
* @throws WxErrorException the wx error exception
|
||||||
|
*/
|
||||||
|
String setWebViewDomainDirectly(String action, List<String> domainList) throws WxErrorException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 快速配置小程序业务域名
|
||||||
|
* <a href="https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Mini_Program_Basic_Info/setwebviewdomain_directly.html">文档地址</a>
|
||||||
|
*
|
||||||
|
* @param action add添加, delete删除, set覆盖, get获取
|
||||||
|
* @param domainList the domain list
|
||||||
|
* @return web view domain info
|
||||||
|
* @throws WxErrorException the wx error exception
|
||||||
|
*/
|
||||||
|
WxOpenMaWebDomainResult setWebViewDomainDirectlyInfo(String action, List<String> domainList) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取业务域名校验文件
|
* 获取业务域名校验文件
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1307,4 +1307,55 @@ public class WxOpenComponentServiceImpl implements WxOpenComponentService {
|
|||||||
String response = post(OPEN_APPLY_SET_ORDER_PATH_INFO, gson.toJson(info));
|
String response = post(OPEN_APPLY_SET_ORDER_PATH_INFO, gson.toJson(info));
|
||||||
return WxOpenGsonBuilder.create().fromJson(response, WxOpenResult.class);
|
return WxOpenGsonBuilder.create().fromJson(response, WxOpenResult.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WxOpenMaDomainResult modifyWxaServerDomain(String action, List<String> requestDomains, List<String> wsRequestDomains,
|
||||||
|
List<String> uploadDomains, List<String> downloadDomains,
|
||||||
|
List<String> udpDomains, List<String> tcpDomains) throws WxErrorException {
|
||||||
|
JsonObject requestJson = new JsonObject();
|
||||||
|
requestJson.addProperty("action", action);
|
||||||
|
if (!"get".equals(action)) {
|
||||||
|
requestJson.add("requestdomain", toJsonArray(requestDomains));
|
||||||
|
requestJson.add("wsrequestdomain", toJsonArray(wsRequestDomains));
|
||||||
|
requestJson.add("uploaddomain", toJsonArray(uploadDomains));
|
||||||
|
requestJson.add("downloaddomain", toJsonArray(downloadDomains));
|
||||||
|
requestJson.add("udpdomain", toJsonArray(udpDomains));
|
||||||
|
requestJson.add("tcpdomain", toJsonArray(tcpDomains));
|
||||||
|
}
|
||||||
|
|
||||||
|
String response = post(API_MODIFY_WXA_SERVER_DOMAIN, requestJson.toString());
|
||||||
|
return WxOpenGsonBuilder.create().fromJson(response, WxOpenMaDomainResult.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WxOpenMaDomainConfirmFileResult getDomainConfirmFile() throws WxErrorException {
|
||||||
|
String responseContent = post(API_GET_DOMAIN_CONFIRM_FILE, "{}");
|
||||||
|
return WxOpenMaDomainConfirmFileResult.fromJson(responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String modifyWxaJumpDomain(String action, List<String> domainList) throws WxErrorException {
|
||||||
|
JsonObject requestJson = new JsonObject();
|
||||||
|
requestJson.addProperty("action", action);
|
||||||
|
if (!"get".equals(action)) {
|
||||||
|
requestJson.add("webviewdomain", toJsonArray(domainList));
|
||||||
|
}
|
||||||
|
return post(API_MODIFY_WXA_JUMP_DOMAIN, requestJson.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WxOpenMaWebDomainResult modifyWxaJumpDomainInfo(String action, List<String> domainList) throws WxErrorException {
|
||||||
|
String response = this.modifyWxaJumpDomain(action, domainList);
|
||||||
|
return WxOpenGsonBuilder.create().fromJson(response, WxOpenMaWebDomainResult.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
private JsonArray toJsonArray(List<String> list) {
|
||||||
|
JsonArray jsonArray = new JsonArray();
|
||||||
|
if (list != null) {
|
||||||
|
for (String item : list) {
|
||||||
|
jsonArray.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return jsonArray;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,25 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
|
|||||||
return WxMaGsonBuilder.create().fromJson(response, WxOpenMaDomainResult.class);
|
return WxMaGsonBuilder.create().fromJson(response, WxOpenMaDomainResult.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WxOpenMaDomainResult modifyDomainDirectly(String action, List<String> requestDomains, List<String> wsRequestDomains,
|
||||||
|
List<String> uploadDomains, List<String> downloadDomains,
|
||||||
|
List<String> udpDomains, List<String> tcpDomains) throws WxErrorException {
|
||||||
|
JsonObject requestJson = new JsonObject();
|
||||||
|
requestJson.addProperty(ACTION, action);
|
||||||
|
if (!ACTION_GET.equals(action)) {
|
||||||
|
requestJson.add("requestdomain", toJsonArray(requestDomains));
|
||||||
|
requestJson.add("wsrequestdomain", toJsonArray(wsRequestDomains));
|
||||||
|
requestJson.add("uploaddomain", toJsonArray(uploadDomains));
|
||||||
|
requestJson.add("downloaddomain", toJsonArray(downloadDomains));
|
||||||
|
requestJson.add("udpdomain", toJsonArray(udpDomains));
|
||||||
|
requestJson.add("tcpdomain", toJsonArray(tcpDomains));
|
||||||
|
}
|
||||||
|
|
||||||
|
String response = post(API_MODIFY_DOMAIN_DIRECTLY, GSON.toJson(requestJson));
|
||||||
|
return WxMaGsonBuilder.create().fromJson(response, WxOpenMaDomainResult.class);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getWebViewDomain() throws WxErrorException {
|
public String getWebViewDomain() throws WxErrorException {
|
||||||
return setWebViewDomain(ACTION_GET, null);
|
return setWebViewDomain(ACTION_GET, null);
|
||||||
@@ -140,6 +159,22 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
|
|||||||
return WxMaGsonBuilder.create().fromJson(response, WxOpenMaWebDomainResult.class);
|
return WxMaGsonBuilder.create().fromJson(response, WxOpenMaWebDomainResult.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String setWebViewDomainDirectly(String action, List<String> domainList) throws WxErrorException {
|
||||||
|
JsonObject requestJson = new JsonObject();
|
||||||
|
requestJson.addProperty(ACTION, action);
|
||||||
|
if (!ACTION_GET.equals(action)) {
|
||||||
|
requestJson.add("webviewdomain", toJsonArray(domainList));
|
||||||
|
}
|
||||||
|
return post(API_SET_WEBVIEW_DOMAIN_DIRECTLY, GSON.toJson(requestJson));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WxOpenMaWebDomainResult setWebViewDomainDirectlyInfo(String action, List<String> domainList) throws WxErrorException {
|
||||||
|
String response = this.setWebViewDomainDirectly(action, domainList);
|
||||||
|
return WxMaGsonBuilder.create().fromJson(response, WxOpenMaWebDomainResult.class);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WxOpenMaDomainConfirmFileResult getWebviewDomainConfirmFile() throws WxErrorException {
|
public WxOpenMaDomainConfirmFileResult getWebviewDomainConfirmFile() throws WxErrorException {
|
||||||
String responseContent = post(API_GET_WEBVIEW_DOMAIN_CONFIRM_FILE, "{}");
|
String responseContent = post(API_GET_WEBVIEW_DOMAIN_CONFIRM_FILE, "{}");
|
||||||
|
|||||||
Reference in New Issue
Block a user