mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 01:58:14 +08:00
feat(wxapi): 新增小程序连接小店获取小程序的定制文件接口
This commit is contained in:
@@ -3281,6 +3281,31 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region ECOpen
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/open/get_download_url 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/API/miniandstore/get_download_url.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECOpenGetDownloadUrlResponse> ExecuteChannelsECOpenGetDownloadUrlAsync(this WechatApiClient client, Models.ChannelsECOpenGetDownloadUrlRequest 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", "open", "get_download_url")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOpenGetDownloadUrlResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ECOrder
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/order/search 接口。</para>
|
||||
|
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/open/get_download_url 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECOpenGetDownloadUrlRequest : WechatApiRequest, IInferable<ChannelsECOpenGetDownloadUrlRequest, ChannelsECOpenGetDownloadUrlResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置用户的 OpenId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
||||
public string OpenId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
|
||||
public string OrderId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/open/get_download_url 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECOpenGetDownloadUrlResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置文件下载链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("download_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("download_url")]
|
||||
public string DownloadUrl { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置链接到期时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("expire_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("expire_time")]
|
||||
public long ExpireTimestamp { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"openid": "23982ADD2323",
|
||||
"order_id": "239829312"
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "成功",
|
||||
"download_url": "https://cos.tencent.com/image/test.png",
|
||||
"expire_time": 17823232312
|
||||
}
|
Reference in New Issue
Block a user