mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-04-05 17:37:54 +08:00
feat(wxapi): 新增代商家注册小程序快速注册个人小程序接口
This commit is contained in:
parent
1a9c782bfa
commit
bddc7924ee
@ -1,8 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 INFO.notify_third_fasteregister 事件的数据。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Register_Mini_Programs/Fast_Registration_Interface_document.html </para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/register-management/fast-registration-ind/fastRegisterPersonalMp.html </para>
|
||||
/// </summary>
|
||||
public class NotifyThirdFastRegisterEvent : WechatApiEvent, WechatApiEvent.Serialization.IXmlSerializable
|
||||
{
|
||||
@ -13,32 +14,44 @@
|
||||
/// <summary>
|
||||
/// 获取或设置企业名称。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("name")]
|
||||
public string EnterpriseName { get; set; } = default!;
|
||||
[System.Xml.Serialization.XmlElement("name", IsNullable = true)]
|
||||
public string? EnterpriseName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业代码类型。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("code_type")]
|
||||
public int LicenseType { get; set; }
|
||||
[System.Xml.Serialization.XmlElement("code_type", IsNullable = true)]
|
||||
public int? LicenseType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业代码。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("code")]
|
||||
public string LicenseNumber { get; set; } = default!;
|
||||
[System.Xml.Serialization.XmlElement("code", IsNullable = true)]
|
||||
public string? LicenseNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置法人姓名。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("legal_persona_name")]
|
||||
public string LegalPersonName { get; set; } = default!;
|
||||
[System.Xml.Serialization.XmlElement("legal_persona_name", IsNullable = true)]
|
||||
public string? LegalPersonName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置法人微信号。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("legal_persona_wechat")]
|
||||
public string LegalPersonWxname { get; set; } = default!;
|
||||
[System.Xml.Serialization.XmlElement("legal_persona_wechat", IsNullable = true)]
|
||||
public string? LegalPersonWxname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户姓名。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("legal_persona_wechat", IsNullable = true)]
|
||||
public string? IdName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户微信号。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("wxuser", IsNullable = true)]
|
||||
public string? Wxname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置第三方联系电话。
|
||||
|
@ -262,6 +262,48 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinComponentFastRegisterWeappSearchResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/component/fastregisterpersonalweapp?action=create 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/register-management/fast-registration-ind/fastRegisterPersonalMp.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinComponentFastRegisterPersonalWeappCreateResponse> ExecuteCgibinComponentFastRegisterPersonalWeappCreateAsync(this WechatApiClient client, Models.CgibinComponentFastRegisterPersonalWeappCreateRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "component", "fastregisterpersonalweapp")
|
||||
.SetQueryParam("action", "create")
|
||||
.SetQueryParam("component_access_token", request.ComponentAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinComponentFastRegisterPersonalWeappCreateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/component/fastregisterpersonalweapp?action=query 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/register-management/fast-registration-ind/fastRegisterPersonalMp.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinComponentFastRegisterPersonalWeappQueryResponse> ExecuteCgibinComponentFastRegisterPersonalWeappQueryAsync(this WechatApiClient client, Models.CgibinComponentFastRegisterPersonalWeappQueryRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "component", "fastregisterpersonalweapp")
|
||||
.SetQueryParam("action", "query")
|
||||
.SetQueryParam("component_access_token", request.ComponentAccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinComponentFastRegisterPersonalWeappQueryResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/component/modify_wxa_server_domain 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/ThirdParty/domain/modify_server_domain.html </para>
|
||||
|
@ -0,0 +1,36 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/component/fastregisterpersonalweapp?action=create 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinComponentFastRegisterPersonalWeappCreateRequest : WechatApiRequest, IInferable<CgibinComponentFastRegisterPersonalWeappCreateRequest, CgibinComponentFastRegisterPersonalWeappCreateResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方平台 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ComponentAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置个人用户名字。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("idname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("idname")]
|
||||
public string IdName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置个人用户微信号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wxuser")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wxuser")]
|
||||
public string Wxname { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置第三方联系电话。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("component_phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("component_phone")]
|
||||
public string? ComponentPhoneNumber { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/component/fastregisterpersonalweapp?action=create 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinComponentFastRegisterPersonalWeappCreateResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("taskid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("taskid")]
|
||||
public string TaskId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置扫码认证链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("authorize_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("authorize_url")]
|
||||
public string? AuthorizeUrl { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/component/fastregisterpersonalweapp?action=query 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinComponentFastRegisterPersonalWeappQueryRequest : WechatApiRequest, IInferable<CgibinComponentFastRegisterPersonalWeappQueryRequest, CgibinComponentFastRegisterPersonalWeappCreateResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方平台 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ComponentAccessToken { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("taskid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("taskid")]
|
||||
public string TaskId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/component/fastregisterpersonalweapp?action=query 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinComponentFastRegisterPersonalWeappQueryResponse : CgibinComponentFastRegisterPersonalWeappCreateResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"idname": "tencent",
|
||||
"wxuser": "wxidnnn",
|
||||
"component_phone": "1234567"
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "OK",
|
||||
"taskid": "xxxxx",
|
||||
"authorize_url": "https://mp.weixin.qq.com/xxxx",
|
||||
"status": 0
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"taskid": "xxxxx"
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "OK",
|
||||
"taskid": "xxxxx",
|
||||
"authorize_url": "https://mp.weixin.qq.com/xxxx",
|
||||
"status": 0
|
||||
}
|
Loading…
Reference in New Issue
Block a user