feat(wxapi): 新增微信小店合作商家为小程序发放礼物相关接口

This commit is contained in:
Fu Diwei
2026-02-05 17:53:56 +08:00
parent 1a9793ffc3
commit 71cfa74c3d
30 changed files with 1019 additions and 2 deletions

View File

@@ -634,6 +634,56 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
#endregion
#endregion
#region ECB2C
#region ECB2C/Activity
/// <summary>
/// <para>异步调用 [POST] /channels/ec/b2c/activity/list/promoter/get 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/miniandstore/cooperation_gift/api_list_present_activity.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ChannelsECB2CActivityListPromoterGetResponse> ExecuteChannelsECB2CActivityListPromoterGetAsync(this WechatApiClient client, Models.ChannelsECB2CActivityListPromoterGetRequest 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", "b2c", "activity", "list", "promoter", "get")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECB2CActivityListPromoterGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [POST] /channels/ec/b2c/activity/info/promoter/get 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/miniandstore/cooperation_gift/api_get_activity.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ChannelsECB2CActivityInfoPromoterGetResponse> ExecuteChannelsECB2CActivityInfoPromoterGetAsync(this WechatApiClient client, Models.ChannelsECB2CActivityInfoPromoterGetRequest 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", "b2c", "activity", "info", "promoter", "get")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECB2CActivityInfoPromoterGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
#endregion
#endregion
#region ECBasics
/// <summary>
/// <para>异步调用 [GET] /channels/ec/basics/info/get 接口。</para>
@@ -5132,6 +5182,54 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
#endregion
#endregion
#region ECOrder/Present
/// <summary>
/// <para>异步调用 [POST] /channels/ec/order/presentlist/get 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/miniandstore/cooperation_gift/api_get_present_list.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ChannelsECOrderPresentListGetResponse> ExecuteChannelsECOrderPresentListGetAsync(this WechatApiClient client, Models.ChannelsECOrderPresentListGetRequest 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", "order", "presentlist", "get")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOrderPresentListGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /channels/ec/order/present/get 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/miniandstore/cooperation_gift/api_get_present.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ChannelsECOrderPresentGetResponse> ExecuteChannelsECOrderPresentGetAsync(this WechatApiClient client, Models.ChannelsECOrderPresentGetRequest 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", "order", "present", "get")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOrderPresentGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region ECOrder/PresentOrder
/// <summary>
/// <para>异步调用 [POST] /channels/ec/order/presentorder/create 接口。</para>
@@ -5167,6 +5265,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
[Obsolete("相关接口或字段于 2025-12-08 下线。")]
public static async Task<Models.ChannelsECOrderPresentOrderListGetResponse> ExecuteChannelsECOrderPresentOrderListGetAsync(this WechatApiClient client, Models.ChannelsECOrderPresentOrderListGetRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
@@ -5190,6 +5289,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
[Obsolete("相关接口或字段于 2025-12-08 下线。")]
public static async Task<Models.ChannelsECOrderPresentOrderGetResponse> ExecuteChannelsECOrderPresentOrderGetAsync(this WechatApiClient client, Models.ChannelsECOrderPresentOrderGetRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
@@ -5201,6 +5301,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOrderPresentOrderGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /channels/ec/order/presentorder/receiver/set 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/miniandstore/cooperation_gift/api_set_present_receiver.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ChannelsECOrderPresentOrderReceiverSetResponse> ExecuteChannelsECOrderPresentOrderReceiverSetAsync(this WechatApiClient client, Models.ChannelsECOrderPresentOrderReceiverSetRequest 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", "order", "presentorder", "receiver", "set")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOrderPresentOrderReceiverSetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region ECOrder/PreshipmentChangeSKU
@@ -5273,6 +5396,31 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOrderPreshipmentChangeSKUGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region ECOrder/ReceiverOrder
/// <summary>
/// <para>异步调用 [POST] /channels/ec/order/receiverorderlist/get 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/miniandstore/cooperation_gift/api_get_receiver_order_list.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ChannelsECOrderReceiverOrderListGetResponse> ExecuteChannelsECOrderReceiverOrderListGetAsync(this WechatApiClient client, Models.ChannelsECOrderReceiverOrderListGetRequest 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", "order", "presentlist", "get")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOrderReceiverOrderListGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#endregion
#region ECProduct
@@ -8604,7 +8752,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECWecomGetWecomIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
#endregion
#region ECWindow
/// <summary>
/// <para>异步调用 [POST] /channels/ec/window/product/add 接口。</para>

View File

@@ -13,6 +13,24 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
public class ProductInfo
{
/// <summary>
/// 获取或设置商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_id")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberReadOnlyConverter))]
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))]
public long? ProductId { get; set; }
/// <summary>
/// 获取或设置 SKU ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("sku_id")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberReadOnlyConverter))]
[System.Text.Json.Serialization.JsonPropertyName("sku_id")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))]
public long? SKUId { get; set; }
/// <summary>
/// 获取或设置商品名称。
/// </summary>

View File

@@ -0,0 +1,22 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/b2c/activity/info/promoter/get 接口的请求。</para>
/// </summary>
public class ChannelsECB2CActivityInfoPromoterGetRequest : WechatApiRequest, IInferable<ChannelsECB2CActivityInfoPromoterGetRequest, ChannelsECB2CActivityInfoPromoterGetResponse>
{
/// <summary>
/// 获取或设置小店 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("shop_appid")]
[System.Text.Json.Serialization.JsonPropertyName("shop_appid")]
public string ShopAppId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置活动 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("activity_id")]
[System.Text.Json.Serialization.JsonPropertyName("activity_id")]
public long ActivityId { get; set; }
}
}

View File

@@ -0,0 +1,183 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/b2c/activity/info/promoter/get 接口的响应。</para>
/// </summary>
public class ChannelsECB2CActivityInfoPromoterGetResponse : WechatApiResponse
{
public static class Types
{
public class Activity
{
public static class Types
{
public class ActivityInfo
{
public static class Types
{
public class BasicInfo
{
public static class Types
{
public class ShopInfo
{
/// <summary>
/// 获取或设置小店 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("appid")]
[System.Text.Json.Serialization.JsonPropertyName("appid")]
public string AppId { get; set; } = default!;
/// <summary>
/// 获取或设置小店名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("nickname")]
[System.Text.Json.Serialization.JsonPropertyName("nickname")]
public string Nickname { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置活动开始时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("activity_start_time")]
[System.Text.Json.Serialization.JsonPropertyName("activity_start_time")]
public long ActivityStartTimestamp { get; set; }
/// <summary>
/// 获取或设置活动结束时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("activity_end_time")]
[System.Text.Json.Serialization.JsonPropertyName("activity_end_time")]
public long ActivityEndTimestamp { get; set; }
/// <summary>
/// 获取或设置店铺信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("shop_info")]
[System.Text.Json.Serialization.JsonPropertyName("shop_info")]
public Types.ShopInfo ShopInfo { get; set; } = default!;
}
public class PrizeInfo
{
public static class Types
{
public class ProductInfo
{
/// <summary>
/// 获取或设置商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_id")]
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long ProductId { get; set; }
/// <summary>
/// 获取或设置商品名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_name")]
[System.Text.Json.Serialization.JsonPropertyName("product_name")]
public string ProductName { get; set; } = default!;
/// <summary>
/// 获取或设置商品图片 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_img_url")]
[System.Text.Json.Serialization.JsonPropertyName("product_img_url")]
public string ProductImageUrl { get; set; } = default!;
/// <summary>
/// 获取或设置 SKU ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("sku_id")]
[System.Text.Json.Serialization.JsonPropertyName("sku_id")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long SKUId { get; set; }
/// <summary>
/// 获取或设置 SKU 名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("sku_name")]
[System.Text.Json.Serialization.JsonPropertyName("sku_name")]
public string SKUName { get; set; } = default!;
/// <summary>
/// 获取或设置售卖单价(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("price")]
[System.Text.Json.Serialization.JsonPropertyName("price")]
public int Price { get; set; }
/// <summary>
/// 获取或设置活动总库存。
/// </summary>
[Newtonsoft.Json.JsonProperty("stock_num")]
[System.Text.Json.Serialization.JsonPropertyName("stock_num")]
public int Stock { get; set; }
/// <summary>
/// 获取或设置活动剩余库存。
/// </summary>
[Newtonsoft.Json.JsonProperty("can_use_stock_num")]
[System.Text.Json.Serialization.JsonPropertyName("can_use_stock_num")]
public int StockCanUsed { get; set; }
}
}
/// <summary>
/// 获取或设置商品信息列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_info_list")]
[System.Text.Json.Serialization.JsonPropertyName("product_info_list")]
public Types.ProductInfo[] ProductInfoList { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置活动基础信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("basic_info")]
[System.Text.Json.Serialization.JsonPropertyName("basic_info")]
public Types.BasicInfo BasicInfo { get; set; } = default!;
/// <summary>
/// 获取或设置活动礼物商品信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("prize_info")]
[System.Text.Json.Serialization.JsonPropertyName("prize_info")]
public Types.PrizeInfo PrizeInfo { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置活动 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("activity_id")]
[System.Text.Json.Serialization.JsonPropertyName("activity_id")]
public long ActivityId { get; set; }
/// <summary>
/// 获取或设置活动状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("status")]
[System.Text.Json.Serialization.JsonPropertyName("status")]
public int Status { get; set; }
/// <summary>
/// 获取或设置活动信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("info")]
[System.Text.Json.Serialization.JsonPropertyName("info")]
public Types.ActivityInfo ActivityInfo { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置活动信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("activity")]
[System.Text.Json.Serialization.JsonPropertyName("activity")]
public Types.Activity Activity { get; set; } = default!;
}
}

View File

@@ -0,0 +1,37 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/b2c/activity/list/promoter/get 接口的请求。</para>
/// </summary>
public class ChannelsECB2CActivityListPromoterGetRequest : WechatApiRequest, IInferable<ChannelsECB2CActivityListPromoterGetRequest, ChannelsECB2CActivityListPromoterGetResponse>
{
/// <summary>
/// 获取或设置小店 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("shop_appid")]
[System.Text.Json.Serialization.JsonPropertyName("shop_appid")]
public string? ShopAppId { get; set; }
/// <summary>
/// 获取或设置活动状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("status")]
[System.Text.Json.Serialization.JsonPropertyName("status")]
public int? Status { get; set; }
/// <summary>
/// 获取或设置分页起始位置。
/// </summary>
[Newtonsoft.Json.JsonProperty("offset")]
[System.Text.Json.Serialization.JsonPropertyName("offset")]
public int Offset { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// <para>默认值100</para>
/// </summary>
[Newtonsoft.Json.JsonProperty("limit")]
[System.Text.Json.Serialization.JsonPropertyName("limit")]
public int Limit { get; set; } = 100;
}
}

View File

@@ -0,0 +1,57 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/b2c/activity/list/promoter/get 接口的响应。</para>
/// </summary>
public class ChannelsECB2CActivityListPromoterGetResponse : WechatApiResponse
{
public static class Types
{
public class Activity
{
/// <summary>
/// 获取或设置小店 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("shop_appid")]
[System.Text.Json.Serialization.JsonPropertyName("shop_appid")]
public string ShopAppId { get; set; } = default!;
/// <summary>
/// 获取或设置小店名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("shop_nickname")]
[System.Text.Json.Serialization.JsonPropertyName("shop_nickname")]
public string ShopName { get; set; } = default!;
/// <summary>
/// 获取或设置活动 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("activity_id")]
[System.Text.Json.Serialization.JsonPropertyName("activity_id")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long ActivityId { get; set; }
/// <summary>
/// 获取或设置活动状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("status")]
[System.Text.Json.Serialization.JsonPropertyName("status")]
public int Status { get; set; }
}
}
/// <summary>
/// 获取或设置活动列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("list")]
[System.Text.Json.Serialization.JsonPropertyName("list")]
public Types.Activity[] ActivityList { get; set; } = default!;
/// <summary>
/// 获取或设置总数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("total_num")]
[System.Text.Json.Serialization.JsonPropertyName("total_num")]
public int TotalCount { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/present/get 接口的请求。</para>
/// </summary>
public class ChannelsECOrderPresentGetRequest : WechatApiRequest, IInferable<ChannelsECOrderPresentGetRequest, ChannelsECOrderPresentGetResponse>
{
/// <summary>
/// 获取或设置礼物订单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("present_order_id")]
[System.Text.Json.Serialization.JsonPropertyName("present_order_id")]
public string PresentOrderId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,138 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/present/get 接口的响应。</para>
/// </summary>
public class ChannelsECOrderPresentGetResponse : WechatApiResponse
{
public static class Types
{
public class PresentOrder
{
public static class Types
{
public class PresentDetail
{
public static class Types
{
public class PriceInfo
{
/// <summary>
/// 获取或设置价格(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("order_price")]
[System.Text.Json.Serialization.JsonPropertyName("order_price")]
public int Price { get; set; }
}
public class PayInfo
{
/// <summary>
/// 获取或设置支付时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("pay_time")]
[System.Text.Json.Serialization.JsonPropertyName("pay_time")]
public long PayTimestamp { get; set; }
}
}
/// <summary>
/// 获取或设置价格信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("price_info")]
[System.Text.Json.Serialization.JsonPropertyName("price_info")]
public Types.PriceInfo? PriceInfo { get; set; }
/// <summary>
/// 获取或设置支付信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("pay_info")]
[System.Text.Json.Serialization.JsonPropertyName("pay_info")]
public Types.PayInfo? PayInfo { get; set; }
/// <summary>
/// 获取或设置祝福语。
/// </summary>
[Newtonsoft.Json.JsonProperty("wishmessage")]
[System.Text.Json.Serialization.JsonPropertyName("wishmessage")]
public string? WishMessage { get; set; }
}
public class SubOrder
{
/// <summary>
/// 获取或设置子单订单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("order_id")]
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
public string OrderId { get; set; } = default!;
/// <summary>
/// 获取或设置收礼者 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("openid")]
[System.Text.Json.Serialization.JsonPropertyName("openid")]
public string OpenId { get; set; } = default!;
/// <summary>
/// 获取或设置子单订单状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("status")]
[System.Text.Json.Serialization.JsonPropertyName("status")]
public int Status { get; set; }
}
}
/// <summary>
/// 获取或设置礼物订单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("present_order_id")]
[System.Text.Json.Serialization.JsonPropertyName("present_order_id")]
public string PresentOrderId { get; set; } = default!;
/// <summary>
/// 获取或设置是否付款。
/// </summary>
[Newtonsoft.Json.JsonProperty("is_b2c_free_present")]
[System.Text.Json.Serialization.JsonPropertyName("is_b2c_free_present")]
public bool IsB2CFreePresent { get; set; }
/// <summary>
/// 获取或设置礼物详情。
/// </summary>
[Newtonsoft.Json.JsonProperty("present_detail")]
[System.Text.Json.Serialization.JsonPropertyName("present_detail")]
public Types.PresentDetail PresentDetail { get; set; } = default!;
/// <summary>
/// 获取或设置子单列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_order_list")]
[System.Text.Json.Serialization.JsonPropertyName("sub_order_list")]
public Types.SubOrder[] SubOrderList { get; set; } = default!;
/// <summary>
/// 获取或设置关联活动 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("activity_id")]
[System.Text.Json.Serialization.JsonPropertyName("activity_id")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long? ActivityId { get; set; }
/// <summary>
/// 获取或设置创建时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("create_time")]
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
public long CreateTimestamp { get; set; }
}
}
/// <summary>
/// 获取或设置礼物订单信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("present")]
[System.Text.Json.Serialization.JsonPropertyName("present")]
public Types.PresentOrder PresentOrder { get; set; } = default!;
}
}

View File

@@ -0,0 +1,51 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/presentlist/get 接口的请求。</para>
/// </summary>
public class ChannelsECOrderPresentListGetRequest : WechatApiRequest, IInferable<ChannelsECOrderPresentListGetRequest, ChannelsECOrderPresentListGetResponse>
{
public static class Types
{
public class TimeRange : ChannelsECOrderListGetRequest.Types.TimeRange
{
}
}
/// <summary>
/// 获取或设置合作小店 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("shop_appid")]
[System.Text.Json.Serialization.JsonPropertyName("shop_appid")]
public string ShopAppId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置创建订单时间范围。
/// </summary>
[Newtonsoft.Json.JsonProperty("create_time_range")]
[System.Text.Json.Serialization.JsonPropertyName("create_time_range")]
public Types.TimeRange? CreateTimeRange { get; set; }
/// <summary>
/// 获取或设置更新订单时间范围。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time_range")]
[System.Text.Json.Serialization.JsonPropertyName("update_time_range")]
public Types.TimeRange? UpdateTimeRange { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// <para>默认值10</para>
/// </summary>
[Newtonsoft.Json.JsonProperty("page_size")]
[System.Text.Json.Serialization.JsonPropertyName("page_size")]
public int Limit { get; set; } = 10;
/// <summary>
/// 获取或设置翻页标记。
/// </summary>
[Newtonsoft.Json.JsonProperty("next_key")]
[System.Text.Json.Serialization.JsonPropertyName("next_key")]
public string? Cursor { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/presentlist/get 接口的响应。</para>
/// </summary>
public class ChannelsECOrderPresentListGetResponse : WechatApiResponse
{
public static class Types
{
public class PresentOrder
{
/// <summary>
/// 获取或设置礼物订单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("present_order_id")]
[System.Text.Json.Serialization.JsonPropertyName("present_order_id")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))]
public string PresentOrderId { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置礼物订单列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("present_order_list")]
[System.Text.Json.Serialization.JsonPropertyName("present_order_list")]
public Types.PresentOrder[] PresentOrderList { get; set; } = default!;
/// <summary>
/// 获取或设置翻页标记。
/// </summary>
[Newtonsoft.Json.JsonProperty("next_key")]
[System.Text.Json.Serialization.JsonPropertyName("next_key")]
public string? NextCursor { get; set; }
}
}

View File

@@ -25,6 +25,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
}
}
/// <summary>
/// 获取或设置请求幂等 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("idempotent_id")]
[System.Text.Json.Serialization.JsonPropertyName("idempotent_id")]
public string? IdempotentId { get; set; }
/// <summary>
/// 获取或设置活动 ID。
/// </summary>

View File

@@ -1,8 +1,11 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/presentorder/get 接口的请求。</para>
/// </summary>
[Obsolete("相关接口或字段于 2025-12-08 下线。")]
public class ChannelsECOrderPresentOrderGetRequest : WechatApiRequest, IInferable<ChannelsECOrderPresentOrderGetRequest, ChannelsECOrderPresentOrderGetResponse>
{
/// <summary>

View File

@@ -1,8 +1,11 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/presentorder/get 接口的响应。</para>
/// </summary>
[Obsolete("相关接口或字段于 2025-12-08 下线。")]
public class ChannelsECOrderPresentOrderGetResponse : WechatApiResponse
{
public static class Types

View File

@@ -1,8 +1,11 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/presentorderlist/get 接口的请求。</para>
/// </summary>
[Obsolete("相关接口或字段于 2025-12-08 下线。")]
public class ChannelsECOrderPresentOrderListGetRequest : WechatApiRequest, IInferable<ChannelsECOrderPresentOrderListGetRequest, ChannelsECOrderPresentOrderListGetResponse>
{
public static class Types

View File

@@ -1,8 +1,11 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/presentorderlist/get 接口的响应。</para>
/// </summary>
[Obsolete("相关接口或字段于 2025-12-08 下线。")]
public class ChannelsECOrderPresentOrderListGetResponse : WechatApiResponse
{
public static class Types
@@ -18,7 +21,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
public string PresentOrderId { get; set; } = default!;
/// <summary>
/// 获取或设置订单 ID 列表。
/// 获取或设置子单订单 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("order_id")]
[System.Text.Json.Serialization.JsonPropertyName("order_id")]

View File

@@ -0,0 +1,44 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/presentorder/receiver/set 接口的请求。</para>
/// </summary>
public class ChannelsECOrderPresentOrderReceiverSetRequest : WechatApiRequest, IInferable<ChannelsECOrderPresentOrderReceiverSetRequest, ChannelsECOrderPresentOrderReceiverSetResponse>
{
public static class Types
{
public class SubOrder
{
/// <summary>
/// 获取或设置子单订单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("order_id")]
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
public string OrderId { get; set; } = string.Empty;
/// <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("present_order_id")]
[System.Text.Json.Serialization.JsonPropertyName("present_order_id")]
public string PresentOrderId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置子单列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_order_list")]
[System.Text.Json.Serialization.JsonPropertyName("sub_order_list")]
public IList<Types.SubOrder> SubOrderList { get; set; } = new List<Types.SubOrder>();
}
}

View File

@@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/presentorder/receiver/set 接口的响应。</para>
/// </summary>
public class ChannelsECOrderPresentOrderReceiverSetResponse : WechatApiResponse
{
}
}

View File

@@ -0,0 +1,58 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/receiverorderlist/get 接口的请求。</para>
/// </summary>
public class ChannelsECOrderReceiverOrderListGetRequest : WechatApiRequest, IInferable<ChannelsECOrderReceiverOrderListGetRequest, ChannelsECOrderReceiverOrderListGetResponse>
{
public static class Types
{
public class TimeRange : ChannelsECOrderListGetRequest.Types.TimeRange
{
}
}
/// <summary>
/// 获取或设置合作小店 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("shop_appid")]
[System.Text.Json.Serialization.JsonPropertyName("shop_appid")]
public string ShopAppId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置收礼者 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("open_id")]
[System.Text.Json.Serialization.JsonPropertyName("open_id")]
public string OpenId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置创建订单时间范围。
/// </summary>
[Newtonsoft.Json.JsonProperty("create_time_range")]
[System.Text.Json.Serialization.JsonPropertyName("create_time_range")]
public Types.TimeRange? CreateTimeRange { get; set; }
/// <summary>
/// 获取或设置更新订单时间范围。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time_range")]
[System.Text.Json.Serialization.JsonPropertyName("update_time_range")]
public Types.TimeRange? UpdateTimeRange { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// <para>默认值10</para>
/// </summary>
[Newtonsoft.Json.JsonProperty("page_size")]
[System.Text.Json.Serialization.JsonPropertyName("page_size")]
public int Limit { get; set; } = 10;
/// <summary>
/// 获取或设置翻页标记。
/// </summary>
[Newtonsoft.Json.JsonProperty("next_key")]
[System.Text.Json.Serialization.JsonPropertyName("next_key")]
public string? Cursor { get; set; }
}
}

View File

@@ -0,0 +1,44 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/receiverorderlist/get 接口的响应。</para>
/// </summary>
public class ChannelsECOrderReceiverOrderListGetResponse : WechatApiResponse
{
public static class Types
{
public class PresentOrder
{
/// <summary>
/// 获取或设置礼物订单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("present_order_id")]
[System.Text.Json.Serialization.JsonPropertyName("present_order_id")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))]
public string PresentOrderId { get; set; } = default!;
/// <summary>
/// 获取或设置子单订单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("order_id")]
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))]
public string OrderIdList { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置礼物订单列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("order_list")]
[System.Text.Json.Serialization.JsonPropertyName("order_list")]
public Types.PresentOrder[] PresentOrderList { get; set; } = default!;
/// <summary>
/// 获取或设置翻页标记。
/// </summary>
[Newtonsoft.Json.JsonProperty("next_key")]
[System.Text.Json.Serialization.JsonPropertyName("next_key")]
public string? NextCursor { get; set; }
}
}

View File

@@ -0,0 +1,4 @@
{
"shop_appid": "wxxxxxxxxxxxxxxxxx",
"activity_id": "111"
}

View File

@@ -0,0 +1,32 @@
{
"errcode": 0,
"errmsg": "ok",
"activity": {
"activity_id": "111",
"info": {
"basic_info": {
"activity_start_time": "1745856000",
"activity_end_time": "1746028800",
"shop_info": {
"nickname": "小店昵称",
"appid": "wxxxxxxxxxxxxxxxxx"
}
},
"prize_info": {
"product_info_list": [
{
"product_id": "111111111111111",
"sku_id": "2222222222",
"product_img_url": "https://res.wx.qq.com/op_res/1UTAKQSOJopJ5uMwT8EKEWPgJ1RjiMm8XC93FVwJ6GZlPmfXBjqkwVz8QvO985FR-IWAdYj1sMsaVYdl4jEwUA",
"product_name": "商品名称",
"sku_name": "商品sku名称",
"price": "10",
"stock_num": "10",
"can_use_stock_num": "10"
}
]
}
},
"status": 1
}
}

View File

@@ -0,0 +1,17 @@
{
"errcode": 0,
"errmsg": "ok",
"list": [
{
"shop_appid": "wxxxxxxxxxxxxxxxxx",
"shop_nickname": "小店昵称",
"activity_id": "111"
},
{
"shop_appid": "wxxxxxxxxxxxxxxxxx",
"shop_nickname": "小店昵称",
"activity_id": "222"
}
],
"total_num": 2
}

View File

@@ -0,0 +1,3 @@
{
"present_order_id": "4232433395290081234"
}

View File

@@ -0,0 +1,30 @@
{
"errcode": 0,
"errmsg": "ok",
"present": {
"present_order_id": "4232433395290081234",
"create_time": 1763713709,
"present_detail": {
"price_info": {
"order_price": 100
},
"pay_info": {
"pay_time": 1763715605
},
"wishmessage": "大家一起来抽奖"
},
"sub_order_list": [
{
"order_id": "3732433407897635321",
"openid": "oDiTs6_jRMfM4lualWTODbwt42kB",
"status": 30
},
{
"order_id": "3732433407896586753",
"status": 12
}
],
"is_b2c_free_present": false,
"activity_id": "3002981"
}
}

View File

@@ -0,0 +1,9 @@
{
"shop_appid": "wx21b9c6e52edfe3a1",
"create_time_range": {
"start_time": 1749007175,
"end_time": 1749008175
},
"page_size": 10,
"next_key": "CPestckGEPeVxckGGAAgACgAMAA4gKbYu/HiyeYzQJ7JuskA"
}

View File

@@ -0,0 +1,10 @@
{
"errcode": 0,
"errmsg": "ok",
"present_order_list": [
{
"present_order_id": "4226341196275651234"
}
],
"next_key": "CPestckGEPeVxckGGAAgACgAMAA4gKbYu/HiyeYzQJ7JuskA"
}

View File

@@ -0,0 +1,9 @@
{
"present_order_id": "4232433395290081234",
"sub_order_list": [
{
"order_id": "3732433407897635328",
"openid": "omT_t0BEynCijuylUpZCaAAZp0a6"
}
]
}

View File

@@ -0,0 +1,9 @@
{
"shop_appid": "wx0d4f5ddad96dd5ea",
"page_size": 10,
"openid": "okYsb0XK3sTtyW1xteeL7LZmQM7B",
"create_time_range": {
"start_time": 1764518400,
"end_time": 1764604800
}
}

View File

@@ -0,0 +1,11 @@
{
"order_list": [
{
"present_order_id": "4232682644641942011",
"order_id": "3732682646291354361"
}
],
"errcode": 0,
"errmsg": "ok",
"next_key": "CPestckGEPeVxckGGAAgACgAMAA4gKbYu/HiyeYzQJ7JuskA"
}