mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 18:22:24 +08:00
feat(wxapi): 新增视频号小店分享员专属商品链接相关接口
This commit is contained in:
@@ -2427,6 +2427,75 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECSharerGetSharerOrderListResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/sharer/get_sharer_product_h5url 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/channels/API/sharer/get_sharer_product_h5url.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECSharerGetSharerProductH5UrlResponse> ExecuteChannelsECSharerGetSharerProductH5UrlAsync(this WechatApiClient client, Models.ChannelsECSharerGetSharerProductH5UrlRequest 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", "sharer", "get_sharer_product_h5url")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECSharerGetSharerProductH5UrlResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/sharer/get_sharer_product_taglink 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/channels/API/sharer/get_sharer_product_taglink.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECSharerGetSharerProductTagLinkResponse> ExecuteChannelsECSharerGetSharerProductTagLinkAsync(this WechatApiClient client, Models.ChannelsECSharerGetSharerProductTagLinkRequest 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", "sharer", "get_sharer_product_taglink")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECSharerGetSharerProductTagLinkResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/sharer/get_sharer_product_qrcode 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/channels/API/sharer/get_sharer_product_qrcode.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECSharerGetSharerProductQrcodeResponse> ExecuteChannelsECSharerGetSharerProductQrcodeAsync(this WechatApiClient client, Models.ChannelsECSharerGetSharerProductQrcodeRequest 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", "sharer", "get_sharer_product_qrcode")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECSharerGetSharerProductQrcodeResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ECVip
|
||||
|
@@ -16,6 +16,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
||||
public string OpenId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分享员 UnionId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("unionid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("unionid")]
|
||||
public string? UnionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分享员昵称。
|
||||
/// </summary>
|
||||
|
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/sharer/get_sharer_product_h5url 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECSharerGetSharerProductH5UrlRequest : WechatApiRequest, IInferable<ChannelsECSharerGetSharerProductH5UrlRequest, ChannelsECSharerGetSharerProductH5UrlResponse>
|
||||
{
|
||||
/// <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("product_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
|
||||
public long ProductId { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/sharer/get_sharer_product_h5url 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECSharerGetSharerProductH5UrlResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商品 H5 短链。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("product_h5url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("product_h5url")]
|
||||
public string ProductH5Url { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/sharer/get_sharer_product_qrcode 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECSharerGetSharerProductQrcodeRequest : WechatApiRequest, IInferable<ChannelsECSharerGetSharerProductQrcodeRequest, ChannelsECSharerGetSharerProductQrcodeResponse>
|
||||
{
|
||||
/// <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("product_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
|
||||
public long ProductId { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/sharer/get_sharer_product_qrcode 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECSharerGetSharerProductQrcodeResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商品二维码链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("product_qrcode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("product_qrcode")]
|
||||
public string ProductQrcode { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/sharer/get_sharer_product_taglink 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECSharerGetSharerProductTagLinkRequest : WechatApiRequest, IInferable<ChannelsECSharerGetSharerProductTagLinkRequest, ChannelsECSharerGetSharerProductTagLinkResponse>
|
||||
{
|
||||
/// <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("product_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
|
||||
public long ProductId { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/sharer/get_sharer_product_taglink 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECSharerGetSharerProductTagLinkResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商品微信口令。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("product_taglink")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("product_taglink")]
|
||||
public string ProductTagLink { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -12,6 +12,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
||||
public string OpenId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分享员 UnionId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("unionid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("unionid")]
|
||||
public string? UnionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分享员昵称。
|
||||
/// </summary>
|
||||
|
@@ -6,7 +6,8 @@
|
||||
"openid": "OPENID",
|
||||
"nickname": "NICKNAME",
|
||||
"bind_time": 1624082155,
|
||||
"sharer_type": 0
|
||||
"sharer_type": 0,
|
||||
"unionid": "UNIONID"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"openid": "OPENID",
|
||||
"product_id": "324545"
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"product_h5url": "https://channels.weixin.qq.com/shop/a/xsgVVZtSGpqwd45"
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"openid": "OPENID",
|
||||
"product_id": "324545"
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"product_qrcode": "https://store.mp.video.tencent-cloud.com/161/20304/snscosdownload/SH/reserved/642a2b730001a542dbe0b846bcc4b00b002000a1000f4f50"
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"openid": "OPENID",
|
||||
"product_id": "324545"
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"product_taglink": "#视频号小店://视频号小店/jMv2lqYonCP1qqv"
|
||||
}
|
@@ -4,5 +4,6 @@
|
||||
"openid": "OPENID",
|
||||
"nickname": "NICKNAME",
|
||||
"bind_time": 1624082155,
|
||||
"sharer_type": 0
|
||||
"sharer_type": 0,
|
||||
"unionid": "UNIONID"
|
||||
}
|
||||
|
Reference in New Issue
Block a user