mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-23 22:11:40 +08:00
🆕 #2379 【微信开放平台】增加个人小程序快速注册和试用小程序快速注册相关接口
This commit is contained in:
parent
88301a6192
commit
bb6bec04b1
@ -120,6 +120,21 @@ public interface WxOpenComponentService {
|
||||
*/
|
||||
String FAST_REGISTER_WEAPP_SEARCH_URL = "https://api.weixin.qq.com/cgi-bin/component/fastregisterweapp?action=search";
|
||||
|
||||
/**
|
||||
* 快速创建个人小程序接口.
|
||||
*/
|
||||
String FAST_REGISTER_PERSONAL_WEAPP_URL = "https://api.weixin.qq.com/wxa/component/fastregisterpersonalweapp?action=create";
|
||||
|
||||
/**
|
||||
* 查询快速创建个人小程序任务状态接口.
|
||||
*/
|
||||
String FAST_REGISTER_PERSONAL_WEAPP_SEARCH_URL = "https://api.weixin.qq.com/wxa/component/fastregisterpersonalweapp?action=query";
|
||||
|
||||
/**
|
||||
* 快速创建试用小程序接口.
|
||||
*/
|
||||
String FAST_REGISTER_BETA_WEAPP_URL = "https://api.weixin.qq.com/wxa/component/fastregisterbetaweapp";
|
||||
|
||||
/**
|
||||
* 代小程序实现业务.
|
||||
* 小程序代码模版库管理:https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1506504150_nMMh6&token=&lang=zh_CN
|
||||
@ -581,6 +596,39 @@ public interface WxOpenComponentService {
|
||||
WxOpenResult fastRegisterWeappSearch(String name, String legalPersonaWechat, String legalPersonaName) throws WxErrorException;
|
||||
|
||||
|
||||
/**
|
||||
* https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Register_Mini_Programs/fastregisterpersonalweapp.html
|
||||
* 快速创建个人小程序
|
||||
*
|
||||
* @param idname 个人用户名字
|
||||
* @param wxuser 个人用户微信号
|
||||
* @param componentPhone 第三方联系电话
|
||||
* @return the wx open result
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
WxOpenRegisterPersonalWeappResult fastRegisterPersonalWeapp(String idname, String wxuser, String componentPhone) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Register_Mini_Programs/fastregisterpersonalweapp.html
|
||||
* 查询个人小程序注册任务状态
|
||||
*
|
||||
* @param taskid 任务ID
|
||||
* @return the wx open result
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
WxOpenRegisterPersonalWeappResult fastRegisterPersonalWeappSearch(String taskid) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/beta_Mini_Programs/fastregister.html
|
||||
* 注册试用小程序
|
||||
*
|
||||
* @param name 小程序名称
|
||||
* @param openid 微信用户的openid(不是微信号)
|
||||
* @return the wx open result
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
WxOpenRegisterBetaWeappResult fastRegisterBetaWeapp(String name, String openid) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* https://api.weixin.qq.com/product/register/register_shop?component_access_token=xxxxxxxxx
|
||||
* 注册小商店账号
|
||||
|
@ -626,6 +626,34 @@ public class WxOpenComponentServiceImpl implements WxOpenComponentService {
|
||||
return WxOpenGsonBuilder.create().fromJson(response, WxOpenResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxOpenRegisterPersonalWeappResult fastRegisterPersonalWeapp(String idname, String wxuser, String componentPhone) throws WxErrorException {
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("idname", idname);
|
||||
jsonObject.addProperty("wxuser", wxuser);
|
||||
jsonObject.addProperty("component_phone", componentPhone);
|
||||
String response = post(FAST_REGISTER_PERSONAL_WEAPP_URL, jsonObject.toString(), "component_access_token");
|
||||
return WxOpenGsonBuilder.create().fromJson(response, WxOpenRegisterPersonalWeappResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxOpenRegisterPersonalWeappResult fastRegisterPersonalWeappSearch(String taskid) throws WxErrorException {
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("taskid", taskid);
|
||||
String response = post(FAST_REGISTER_PERSONAL_WEAPP_SEARCH_URL, jsonObject.toString(), "component_access_token");
|
||||
return WxOpenGsonBuilder.create().fromJson(response, WxOpenRegisterPersonalWeappResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxOpenRegisterBetaWeappResult fastRegisterBetaWeapp(String name, String openid) throws WxErrorException {
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("name", name);
|
||||
jsonObject.addProperty("openid", openid);
|
||||
String response = wxOpenService.getWxOpenComponentService()
|
||||
.post(FAST_REGISTER_BETA_WEAPP_URL, jsonObject.toString(), "access_token");
|
||||
return WxOpenGsonBuilder.create().fromJson(response, WxOpenRegisterBetaWeappResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxOpenResult registerShop(String wxName, String idCardName, String idCardNumber, String channelId, Integer apiOpenstoreType, String authPageUrl) throws WxErrorException {
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
|
@ -102,6 +102,21 @@ public class WxOpenXmlMessage implements Serializable {
|
||||
@XStreamAlias("component_phone")
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String componentPhone;
|
||||
|
||||
// 创建个人小程序审核通知数据
|
||||
@XStreamAlias("wxuser")
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String wxuser;
|
||||
|
||||
@XStreamAlias("idname")
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String idname;
|
||||
|
||||
// 创建试用小程序成功/失败的通知数据
|
||||
@XStreamAlias("unique_id")
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String uniqueId;
|
||||
|
||||
}
|
||||
|
||||
public static String wxMpOutXmlMessageToEncryptedXml(WxMpXmlOutMessage message, WxOpenConfigStorage wxOpenConfigStorage) {
|
||||
|
@ -0,0 +1,14 @@
|
||||
package me.chanjar.weixin.open.bean.result;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WxOpenRegisterBetaWeappResult extends WxOpenResult {
|
||||
@SerializedName("authorize_url")
|
||||
private String authorizeUrl;
|
||||
@SerializedName("unique_id")
|
||||
protected String uniqueId;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package me.chanjar.weixin.open.bean.result;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WxOpenRegisterPersonalWeappResult extends WxOpenResult {
|
||||
private String taskid;
|
||||
@SerializedName("authorize_url")
|
||||
private String authorizeUrl;
|
||||
@SerializedName("status")
|
||||
private Integer status;
|
||||
}
|
Loading…
Reference in New Issue
Block a user