mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-20 02:29:40 +08:00
feat(wxapi): 新增小程序联盟查推广 Tag 解析接口
This commit is contained in:
@@ -258,6 +258,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
|||||||
|
|
||||||
return await client.SendRequestWithJsonAsync<Models.UnionPromoterProductGenerateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
return await client.SendRequestWithJsonAsync<Models.UnionPromoterProductGenerateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /union/promoter/product/parse_tag 接口。</para>
|
||||||
|
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/union/access-guidelines/promoter/api/parse_tag.html </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.UnionPromoterProductParseTagResponse> ExecuteUnionPromoterProductParseTagAsync(this WechatApiClient client, Models.UnionPromoterProductParseTagRequest 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, "union", "promoter", "product", "parse_tag")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendRequestWithJsonAsync<Models.UnionPromoterProductParseTagResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region OpenProduct
|
#region OpenProduct
|
||||||
|
@@ -0,0 +1,17 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /union/promoter/product/parse_tag 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class UnionPromoterProductParseTagRequest : WechatApiRequest, IInferable<UnionPromoterProductParseTagRequest, UnionPromoterProductParseTagResponse>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置商品推广 Tag 列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("tagList")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("tagList")]
|
||||||
|
public IList<string> TagList { get; set; } = new List<string>();
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,58 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /union/promoter/product/parse_tag 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class UnionPromoterProductParseTagResponse : WechatApiResponse
|
||||||
|
{
|
||||||
|
public static class Types
|
||||||
|
{
|
||||||
|
public class Tag
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置商品 ID。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("productId")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("productId")]
|
||||||
|
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
|
||||||
|
public long ProductId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置商品来源。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("source")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("source")]
|
||||||
|
public int Source { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置小商店 AppId。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("productAppid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("productAppid")]
|
||||||
|
public string AppId { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置错误码。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("errcode")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("errcode")]
|
||||||
|
public int? ErrorCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置错误描述。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("errmsg")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("errmsg")]
|
||||||
|
public string? ErrorMessage { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置商品推广 Tag 列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("tagList")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("tagList")]
|
||||||
|
|
||||||
|
public Types.Tag[] TagList { get; set; } = default!;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"tagList": ["#小程序://好物精选/测试商品***/YcaJDQiDOFEFr5g"]
|
||||||
|
}
|
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"errcode": 0,
|
||||||
|
"errmsg": "ok",
|
||||||
|
"tagList": [
|
||||||
|
{
|
||||||
|
"productId": "523480",
|
||||||
|
"source": 1,
|
||||||
|
"productAppid": "wx645f5f855bf419"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Reference in New Issue
Block a user