diff --git a/docs/WechatApi/Basic_ModelDefinition.md b/docs/WechatApi/Basic_ModelDefinition.md index e1001230..a713f23d 100644 --- a/docs/WechatApi/Basic_ModelDefinition.md +++ b/docs/WechatApi/Basic_ModelDefinition.md @@ -162,7 +162,22 @@ -#### 5. 微信小店(原视频号) +#### 5. 视频号 + +
+ +[展开查看] + +| | 微信 API | 备注 | +| :-: | :--------: | :--: | +| √ | 视频号小店 | | +| √ | 视频号助手 | | +| √ | 联盟带货 | | +| √ | 本地生活 | | + +
+ +#### 6. 微信小店
@@ -178,7 +193,7 @@
-#### 6. 开放平台 +#### 7. 开放平台
diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs index 6a850ad2..20847953 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs @@ -4104,6 +4104,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } + /// + /// 异步调用 [POST] /channels/ec/product/scheme/get 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task 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(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + #region ECProduct/LimitedDiscountTask /// /// 异步调用 [POST] /channels/ec/product/limiteddiscounttask/add 接口。 diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderCreateRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderCreateRequest.cs index dbf4eb8f..474337ea 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderCreateRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderCreateRequest.cs @@ -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; } + + /// + /// 获取或设置商品额外信息。 + /// + [Newtonsoft.Json.JsonProperty("goods_ext")] + [System.Text.Json.Serialization.JsonPropertyName("goods_ext")] + public string? GoodsExtraInfo { get; set; } } } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/ChannelsECProductSchemeGetRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/ChannelsECProductSchemeGetRequest.cs new file mode 100644 index 00000000..520e09d0 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/ChannelsECProductSchemeGetRequest.cs @@ -0,0 +1,36 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/product/scheme/get 接口的请求。 + /// + public class ChannelsECProductSchemeGetRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("product_id")] + [System.Text.Json.Serialization.JsonPropertyName("product_id")] + public long ProductId { get; set; } + + /// + /// 获取或设置来源 AppId。 + /// + [Newtonsoft.Json.JsonProperty("from_appid")] + [System.Text.Json.Serialization.JsonPropertyName("from_appid")] + public string FromAppId { get; set; } = string.Empty; + + /// + /// 获取或设置过期时间(单位:秒)。 + /// + [Newtonsoft.Json.JsonProperty("expire")] + [System.Text.Json.Serialization.JsonPropertyName("expire")] + public int ExpiresIn { get; set; } + + /// + /// 获取或设置附加信息。 + /// + [Newtonsoft.Json.JsonProperty("ext_info")] + [System.Text.Json.Serialization.JsonPropertyName("ext_info")] + public string? ExtraInfo { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/ChannelsECProductSchemeGetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/ChannelsECProductSchemeGetResponse.cs new file mode 100644 index 00000000..b18a781d --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/ChannelsECProductSchemeGetResponse.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/product/scheme/get 接口的响应。 + /// + public class ChannelsECProductSchemeGetResponse : WechatApiResponse + { + /// + /// 获取或设置商品跳转 Scheme 链接。 + /// + [Newtonsoft.Json.JsonProperty("openlink")] + [System.Text.Json.Serialization.JsonPropertyName("openlink")] + public string OpenLink { get; set; } = default!; + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/ChannelsECProductSchemeGetRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/ChannelsECProductSchemeGetRequest.json new file mode 100644 index 00000000..2055c730 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/ChannelsECProductSchemeGetRequest.json @@ -0,0 +1,5 @@ +{ + "product_id": "324545", + "from_appid": "APPID", + "expire": 100 +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/ChannelsECProductSchemeGetResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/ChannelsECProductSchemeGetResponse.json new file mode 100644 index 00000000..5b377fd9 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/ChannelsECProductSchemeGetResponse.json @@ -0,0 +1,5 @@ +{ + "errcode": 0, + "errmsg": "ok", + "openlink": "weixin://dl/business/?st=123" +}