1
0
mirror of synced 2026-10-07 23:39:43 +08:00

🎨 #4061 【开放平台】增加快速创建企业小程序的接口

This commit is contained in:
allovine
2026-07-02 11:19:52 +08:00
committed by GitHub
parent 4083e3517c
commit eaf28fe495
2 changed files with 57 additions and 1 deletions

View File

@@ -124,6 +124,17 @@ public interface WxOpenComponentService {
* 快速创建小程序接口.
*/
String FAST_REGISTER_WEAPP_URL = "https://api.weixin.qq.com/cgi-bin/component/fastregisterweapp?action=create";
/**
* 快速创建企业小程序接口.
*/
String FAST_REGISTER_ENTERPRISE_WEAPP_URL = "https://api.weixin.qq.com/wxa/component/fastregisterenterpriseweapp?action=create";
/**
* 快速创建企业小程序查询接口.
*/
String FAST_REGISTER_ENTERPRISE_WEAPP_QUERY_URL = "https://api.weixin.qq.com/wxa/component/fastregisterenterpriseweapp?action=query";
/**
* The constant FAST_REGISTER_WEAPP_SEARCH_URL.
*/
@@ -611,7 +622,7 @@ public interface WxOpenComponentService {
/**
* https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=21538208049W8uwq&token=&lang=zh_CN
* 第三方平台快速创建小程序.
* 第三方平台快速创建小程序. 2026-04-30 已下线
* 注意:创建任务逻辑串行,单次任务结束后才可以使用相同信息下发第二次任务,请注意规避任务阻塞
*
* @param name 企业名(需与工商部门登记信息一致)
@@ -622,9 +633,34 @@ public interface WxOpenComponentService {
* @param componentPhone 第三方联系电话(方便法人与第三方联系)
* @return . wx open result
* @throws WxErrorException .
* @deprecated 2026-04-30 接口已经下线
*/
@Deprecated
WxOpenResult fastRegisterWeapp(String name, String code, String codeType, String legalPersonaWechat, String legalPersonaName, String componentPhone) throws WxErrorException;
/**
* https://developers.weixin.qq.com/doc/oplatform/openApi/register-management/fast-registration-ent/api_fastregisterenterpriseweapp.html
* 第三方平台快速创建企业小程序.
* 注意:创建任务逻辑串行,单次任务结束后才可以使用相同信息下发第二次任务,请注意规避任务阻塞
*
* @param name 企业名(需与工商部门登记信息一致)
* @param code 企业代码,18位统一信用代码
* @param componentPhone 第三方联系电话(方便法人与第三方联系)
* @return . wx open result
* @throws WxErrorException .
*/
WxOpenRegisterPersonalWeappResult fastRegisterEnterpriseWeapp(String name, String code, String componentPhone) throws WxErrorException;
/**
* https://developers.weixin.qq.com/doc/oplatform/openApi/register-management/fast-registration-ent/api_fastregisterenterpriseweapp.html
* 查询企业小程序注册任务状态
*
* @param taskid 任务ID
* @return the wx open result
* @throws WxErrorException
*/
WxOpenRegisterPersonalWeappResult fastRegisterEnterpriseWeappQuery(String taskid) throws WxErrorException;
/**
* https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=21538208049W8uwq&token=&lang=zh_CN
* 查询第三方平台快速创建小程序的任务状态

View File

@@ -643,6 +643,26 @@ public class WxOpenComponentServiceImpl implements WxOpenComponentService {
return WxOpenGsonBuilder.create().fromJson(response, WxOpenResult.class);
}
@Override
public WxOpenRegisterPersonalWeappResult fastRegisterEnterpriseWeapp(String name, String code, String componentPhone) throws WxErrorException {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("name", name);
jsonObject.addProperty("code", code);
jsonObject.addProperty("component_phone", componentPhone);
jsonObject.addProperty("new_version", true);
String response = post(FAST_REGISTER_ENTERPRISE_WEAPP_URL, jsonObject.toString(), "access_token");
return WxOpenGsonBuilder.create().fromJson(response, WxOpenRegisterPersonalWeappResult.class);
}
@Override
public WxOpenRegisterPersonalWeappResult fastRegisterEnterpriseWeappQuery(String taskid) throws WxErrorException {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("taskid", taskid);
jsonObject.addProperty("new_version", true);
String response = post(FAST_REGISTER_ENTERPRISE_WEAPP_QUERY_URL, jsonObject.toString(), "access_token");
return WxOpenGsonBuilder.create().fromJson(response, WxOpenRegisterPersonalWeappResult.class);
}
@Override
public WxOpenResult fastRegisterWeappSearch(String name, String legalPersonaWechat, String legalPersonaName) throws WxErrorException {
JsonObject jsonObject = new JsonObject();