feat(wxapi): 新增代商家管理小程序获取业务域名校验文件接口

This commit is contained in:
Fu Diwei 2022-10-26 18:19:47 +08:00
parent f0e4f9611c
commit 99ddcfaefb
4 changed files with 57 additions and 0 deletions

View File

@ -171,6 +171,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendRequestWithJsonAsync<Models.WxaSetWebviewDomainResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /wxa/get_webviewdomain_confirmfile 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/domain-management/getJumpDomainConfirmFile.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.WxaGetWebviewDomainConfirmFileResponse> ExecuteWxaGetWebviewDomainConfirmFileAsync(this WechatApiClient client, Models.WxaGetWebviewDomainConfirmFileRequest 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, "wxa", "get_webviewdomain_confirmfile")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.WxaGetWebviewDomainConfirmFileResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region Register

View File

@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/get_webviewdomain_confirmfile 接口的请求。</para>
/// </summary>
public class WxaGetWebviewDomainConfirmFileRequest : WechatApiRequest, IInferable<WxaGetWebviewDomainConfirmFileRequest, WxaGetWebviewDomainConfirmFileResponse>
{
}
}

View File

@ -0,0 +1,22 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/get_webviewdomain_confirmfile 接口的响应。</para>
/// </summary>
public class WxaGetWebviewDomainConfirmFileResponse : WechatApiResponse
{
/// <summary>
/// 获取或设置文件名。
/// </summary>
[Newtonsoft.Json.JsonProperty("file_name")]
[System.Text.Json.Serialization.JsonPropertyName("file_name")]
public string FileName { get; set; } = default!;
/// <summary>
/// 获取或设置文件内容。
/// </summary>
[Newtonsoft.Json.JsonProperty("file_content")]
[System.Text.Json.Serialization.JsonPropertyName("file_content")]
public string FileContent { get; set; } = default!;
}
}

View File

@ -0,0 +1,6 @@
{
"errcode": 0,
"errmsg": "ok",
"file_name": "xxx",
"file_content": "xxxxxx"
}