mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-02-10 17:56:21 +08:00
feat(wxapi): 新增微信小店小店认证手机号相关接口
This commit is contained in:
@@ -4185,6 +4185,77 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECMerchantAddressDeleteResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ECMerchant/PrivatePhone
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/merchant/privatenumber/sendverifycode 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-order/api_privatenumbersendverifycode.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECMerchantPrivateNumberSendVerifyCodeResponse> ExecuteChannelsECMerchantPrivateNumberSendVerifyCodeAsync(this WechatApiClient client, Models.ChannelsECMerchantPrivateNumberSendVerifyCodeRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "channels", "ec", "merchant", "privatenumber", "sendverifycode")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECMerchantPrivateNumberSendVerifyCodeResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/merchant/privatenumber/addphone 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-order/api_privatenumberaddphone.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECMerchantPrivateNumberAddPhoneResponse> ExecuteChannelsECMerchantPrivateNumberAddPhoneAsync(this WechatApiClient client, Models.ChannelsECMerchantPrivateNumberAddPhoneRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "channels", "ec", "merchant", "privatenumber", "addphone")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECMerchantPrivateNumberAddPhoneResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/merchant/privatenumber/getphone 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-order/api_privatenumbergetshopphone.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECMerchantPrivateNumberGetPhoneResponse> ExecuteChannelsECMerchantPrivateNumberGetPhoneAsync(this WechatApiClient client, Models.ChannelsECMerchantPrivateNumberGetPhoneRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "channels", "ec", "merchant", "privatenumber", "getphone")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECMerchantPrivateNumberGetPhoneResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region ECOpen
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/merchant/privatenumber/addphone 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECMerchantPrivateNumberAddPhoneRequest : WechatApiRequest, IInferable<ChannelsECMerchantPrivateNumberAddPhoneRequest, ChannelsECMerchantPrivateNumberAddPhoneResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置待认证的手机号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("house_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("house_number")]
|
||||
public string MobileNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置短信验证码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("verify_code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("verify_code")]
|
||||
public string VerifyCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小店成员的微信号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wxusername")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wxusername")]
|
||||
public string? Username { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/merchant/privatenumber/addphone 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECMerchantPrivateNumberAddPhoneResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置认证链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("qrcode_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("qrcode_url")]
|
||||
public string QrcodeUrl { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置认证状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public int Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/merchant/privatenumber/getphone 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECMerchantPrivateNumberGetPhoneRequest : WechatApiRequest, IInferable<ChannelsECMerchantPrivateNumberGetPhoneRequest, ChannelsECMerchantPrivateNumberGetPhoneResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置待认证的手机号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("house_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("house_number")]
|
||||
public string MobileNumber { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/merchant/privatenumber/getphone 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECMerchantPrivateNumberGetPhoneResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置认证状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置失败原因。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("fail_reason")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("fail_reason")]
|
||||
public string? FailReason { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/merchant/privatenumber/sendverifycode 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECMerchantPrivateNumberSendVerifyCodeRequest : WechatApiRequest, IInferable<ChannelsECMerchantPrivateNumberSendVerifyCodeRequest, ChannelsECMerchantPrivateNumberSendVerifyCodeResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置待认证的手机号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("house_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("house_number")]
|
||||
public string MobileNumber { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/merchant/privatenumber/sendverifycode 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECMerchantPrivateNumberSendVerifyCodeResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user