mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-12-29 18:04:42 +08:00
feat(wxapi): 新增微信小店获取商品的移动应用跳转 Scheme 码接口
This commit is contained in:
@@ -4104,6 +4104,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECProductQrcodeGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/product/scheme/get 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/product/get_scheme.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECProductSchemeGetResponse> ExecuteChannelsECProductSchemeGetAsync(this WechatApiClient client, Models.ChannelsECProductSchemeGetRequest 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", "product", "scheme", "get")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECProductSchemeGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
#region ECProduct/LimitedDiscountTask
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/product/limiteddiscounttask/add 接口。</para>
|
||||
|
||||
@@ -39,6 +39,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
[Newtonsoft.Json.JsonProperty("out_goods_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_goods_info")]
|
||||
public string? OutGoodsInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品额外信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("goods_ext")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("goods_ext")]
|
||||
public string? GoodsExtraInfo { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/product/scheme/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECProductSchemeGetRequest : WechatApiRequest, IInferable<ChannelsECProductSchemeGetRequest, ChannelsECProductSchemeGetResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商品 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("product_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
|
||||
public long ProductId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置来源 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("from_appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("from_appid")]
|
||||
public string FromAppId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置过期时间(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("expire")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("expire")]
|
||||
public int ExpiresIn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置附加信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("ext_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("ext_info")]
|
||||
public string? ExtraInfo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/product/scheme/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECProductSchemeGetResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商品跳转 Scheme 链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("openlink")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("openlink")]
|
||||
public string OpenLink { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user