Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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 已下线
Comment thread
allovine marked this conversation as resolved.
* 注意:创建任务逻辑串行,单次任务结束后才可以使用相同信息下发第二次任务,请注意规避任务阻塞
*
* @param name 企业名(需与工商部门登记信息一致)
Expand All @@ -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
* 查询第三方平台快速创建小程序的任务状态
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,26 @@ public WxOpenResult fastRegisterWeapp(String name, String code, String codeType,
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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 解析企业注册回调中的 taskid

使用新增企业注册接口时,微信最终的 notify_third_fasteregister 回调只在 <info><taskid>... 中带回任务 ID;但当前消息模型的 WxOpenXmlMessage.Info 没有 taskid 字段(只有旧接口的 name/code/legal_persona_*),因此调用方拿到这个新方法返回的多个 taskid 后,无法在成功或失败回调中关联是哪一个注册任务完成。请同步给 Info 增加 taskid 映射,避免并发创建企业小程序时结果无法对账。

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

}

@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();
Expand Down