feat(wxapi): 新增第三方平台申请设置订单页信息接口

This commit is contained in:
fudiwei
2022-12-01 20:36:16 +08:00
parent 895148e046
commit e99876ca10
4 changed files with 125 additions and 0 deletions

View File

@@ -604,6 +604,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendRequestWithJsonAsync<Models.WxaSecurityGetCodePrivacyInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /wxa/security/applysetorderpathinfo 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/basic-info-management/applySetOrderPathInfo.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.WxaSecurityApplySetOrderPathInfoResponse> ExecuteWxaSecurityApplySetOrderPathInfoAsync(this WechatApiClient client, Models.WxaSecurityApplySetOrderPathInfoRequest 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", "security", "applysetorderpathinfo")
.SetQueryParam("access_token", request.ComponentAccessToken);
return await client.SendRequestWithJsonAsync<Models.WxaSecurityApplySetOrderPathInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region Member

View File

@@ -0,0 +1,79 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/security/applysetorderpathinfo 接口的请求。</para>
/// </summary>
public class WxaSecurityApplySetOrderPathInfoRequest : WechatApiRequest, IInferable<WxaSecurityApplySetOrderPathInfoRequest, WxaSecurityApplySetOrderPathInfoResponse>
{
public static class Types
{
public class BatchRequest
{
/// <summary>
/// 获取或设置页面路径。
/// </summary>
[Newtonsoft.Json.JsonProperty("path")]
[System.Text.Json.Serialization.JsonPropertyName("path")]
public string PagePath { get; set; } = string.Empty;
/// <summary>
/// 获取或设置小程序 AppId 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("appid_list")]
[System.Text.Json.Serialization.JsonPropertyName("appid_list")]
public IList<string>? AppIdList { get; set; }
/// <summary>
/// 获取或设置申请材料图片 URL 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("img_list")]
[System.Text.Json.Serialization.JsonPropertyName("img_list")]
public IList<string>? ImageUrlList { get; set; }
/// <summary>
/// 获取或设置申请材料视频 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("video")]
[System.Text.Json.Serialization.JsonPropertyName("video")]
public string? VideoUrl { get; set; }
/// <summary>
/// 获取或设置测试账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("test_account")]
[System.Text.Json.Serialization.JsonPropertyName("test_account")]
public string? TestAccount { get; set; }
/// <summary>
/// 获取或设置测试账号密码。
/// </summary>
[Newtonsoft.Json.JsonProperty("test_pwd")]
[System.Text.Json.Serialization.JsonPropertyName("test_pwd")]
public string? TestPassword { get; set; }
/// <summary>
/// 获取或设置测试备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("test_remark")]
[System.Text.Json.Serialization.JsonPropertyName("test_remark")]
public string? TestRemark { get; set; }
}
}
/// <summary>
/// 获取或设置第三方平台 AccessToken。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string ComponentAccessToken { get; set; } = string.Empty;
/// <summary>
/// 获取或设置批量申请信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("batch_req")]
[System.Text.Json.Serialization.JsonPropertyName("batch_req")]
public Types.BatchRequest BatchRequest { get; set; } = new Types.BatchRequest();
}
}

View File

@@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/security/applysetorderpathinfo 接口的响应。</para>
/// </summary>
public class WxaSecurityApplySetOrderPathInfoResponse : WechatApiResponse
{
}
}

View File

@@ -0,0 +1,17 @@
{
"batch_req": {
"appid_list": [
"appid1",
"appid2"
],
"path": "pages/test_path",
"img_list": [
"img_url1",
"img_url2"
],
"video": "vedio_url",
"test_account": "test_user",
"test_pwd": "test_pwd",
"test_remark": "测试备注"
}
}