Skip to content

Commit 7718069

Browse files
committed
feat(wxapi): 新增微信小店代发供货商相关接口
1 parent 743c06c commit 7718069

78 files changed

Lines changed: 2322 additions & 46 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
2+
{
3+
/// <summary>
4+
/// <para>表示 EVENT.dropship_order_cancel 事件的数据。</para>
5+
/// <para>
6+
/// REF: <br/>
7+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/supplier/notify/ds_order_notify/ds_order_cancel_notice.html ]]>
8+
/// </para>
9+
/// </summary>
10+
public class DropshipOrderCancelEvent : WechatApiEvent
11+
{
12+
/// <summary>
13+
/// 获取或设置代发单 ID。
14+
/// </summary>
15+
[Newtonsoft.Json.JsonProperty("ds_order_id")]
16+
[System.Text.Json.Serialization.JsonPropertyName("ds_order_id")]
17+
[System.Xml.Serialization.XmlElement("ds_order_id")]
18+
public string DropshipOrderId { get; set; } = default!;
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
2+
{
3+
/// <summary>
4+
/// <para>表示 EVENT.dropship_order_new 事件的数据。</para>
5+
/// <para>
6+
/// REF: <br/>
7+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/supplier/notify/ds_order_notify/ds_order_add_notice.html ]]>
8+
/// </para>
9+
/// </summary>
10+
public class DropshipOrderNewEvent : WechatApiEvent
11+
{
12+
/// <summary>
13+
/// 获取或设置代发单 ID。
14+
/// </summary>
15+
[Newtonsoft.Json.JsonProperty("ds_order_id")]
16+
[System.Text.Json.Serialization.JsonPropertyName("ds_order_id")]
17+
[System.Xml.Serialization.XmlElement("ds_order_id")]
18+
public string DropshipOrderId { get; set; } = default!;
19+
}
20+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
2+
{
3+
/// <summary>
4+
/// <para>表示 EVENT.dropship_order_update 事件的数据。</para>
5+
/// <para>
6+
/// REF: <br/>
7+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/supplier/notify/ds_order_notify/ds_order_update_notice.html ]]>
8+
/// </para>
9+
/// </summary>
10+
public class DropshipOrderUpdateEvent : WechatApiEvent
11+
{
12+
/// <summary>
13+
/// 获取或设置代发单 ID。
14+
/// </summary>
15+
[Newtonsoft.Json.JsonProperty("ds_order_id")]
16+
[System.Text.Json.Serialization.JsonPropertyName("ds_order_id")]
17+
[System.Xml.Serialization.XmlElement("ds_order_id")]
18+
public string DropshipOrderId { get; set; } = default!;
19+
20+
/// <summary>
21+
/// 获取或设置更新时间戳。
22+
/// </summary>
23+
[Newtonsoft.Json.JsonProperty("update_time")]
24+
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
25+
[System.Xml.Serialization.XmlElement("update_time")]
26+
public long UpdateTimestamp { get; set; }
27+
}
28+
}

src/SKIT.FlurlHttpClient.Wechat.Api/Events/Channels/EWaybill/EWaybillPushPathEvent.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
44
/// <para>表示 EVENT.ewaybill_push_path 事件的数据。</para>
55
/// <para>
66
/// REF: <br/>
7-
/// <![CDATA[ https://developers.weixin.qq.com/doc/channels/API/ewaybill/push_path.html ]]>
7+
/// <![CDATA[ https://developers.weixin.qq.com/doc/channels/API/ewaybill/push_path.html ]]> <br/>
8+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/notify/merchant_callback/ewaybill_push_path.html ]]> <br/>
9+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/supplier/notify/merchant_callback/ewaybill_push_path.html ]]>
810
/// </para>
911
/// </summary>
1012
public class EWaybillPushPathEvent : WechatApiEvent

src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs

Lines changed: 510 additions & 21 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [POST] /channels/ec/logistics/ewaybill/biz/order/getprintinfo 接口的请求。</para>
5+
/// </summary>
6+
public class ChannelsECLogisticsEWaybillOrderGetPrintInfoRequest : ChannelsECLogisticsEWaybillPrintGetRequest, IInferable<ChannelsECLogisticsEWaybillOrderGetPrintInfoRequest, ChannelsECLogisticsEWaybillOrderGetPrintInfoResponse>
7+
{
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [POST] /channels/ec/logistics/ewaybill/biz/order/getprintinfo 接口的响应。</para>
5+
/// </summary>
6+
public class ChannelsECLogisticsEWaybillOrderGetPrintInfoResponse : ChannelsECLogisticsEWaybillPrintGetResponse
7+
{
8+
}
9+
}

src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrder/ChannelsECOrderGetResponse.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,12 @@ public class MainProduct
209209
public class Dropship
210210
{
211211
/// <summary>
212-
/// 获取或设置代发单号
212+
/// 获取或设置代发单 ID
213213
/// </summary>
214214
[Newtonsoft.Json.JsonProperty("ds_order_id")]
215215
[System.Text.Json.Serialization.JsonPropertyName("ds_order_id")]
216-
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
217-
public long DropshipOrderId { get; set; }
216+
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))]
217+
public string DropshipOrderId { get; set; } = default!;
218218
}
219219
}
220220

src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrder/Delivery/ChannelsECOrderDeliveryInfoUpdateRequest.cs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,8 @@ public class Delivery
1313
{
1414
public static class Types
1515
{
16-
public class Product
16+
public class Product : ChannelsECOrderDeliverySendRequest.Types.Delivery.Types.Product
1717
{
18-
/// <summary>
19-
/// 获取或设置商品 ID。
20-
/// </summary>
21-
[Newtonsoft.Json.JsonProperty("product_id")]
22-
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
23-
public long ProductId { get; set; }
24-
25-
/// <summary>
26-
/// 获取或设置 SKU ID。
27-
/// </summary>
28-
[Newtonsoft.Json.JsonProperty("sku_id")]
29-
[System.Text.Json.Serialization.JsonPropertyName("sku_id")]
30-
public long SKUId { get; set; }
31-
32-
/// <summary>
33-
/// 获取或设置商品数量。
34-
/// </summary>
35-
[Newtonsoft.Json.JsonProperty("product_cnt")]
36-
[System.Text.Json.Serialization.JsonPropertyName("product_cnt")]
37-
public int Count { get; set; }
3818
}
3919
}
4020

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
using System.Collections.Generic;
2+
3+
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
4+
{
5+
/// <summary>
6+
/// <para>表示 [POST] /channels/ec/order/dropship/assign 接口的请求。</para>
7+
/// </summary>
8+
public class ChannelsECOrderDropshipAssignRequest : WechatApiRequest, IInferable<ChannelsECOrderDropshipAssignRequest, ChannelsECOrderDropshipAssignResponse>
9+
{
10+
public static class Types
11+
{
12+
public class DropshipProduct
13+
{
14+
/// <summary>
15+
/// 获取或设置商品 ID。
16+
/// </summary>
17+
[Newtonsoft.Json.JsonProperty("spu_id")]
18+
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))]
19+
[System.Text.Json.Serialization.JsonPropertyName("spu_id")]
20+
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString)]
21+
public long ProductId { get; set; }
22+
23+
/// <summary>
24+
/// 获取或设置 SKU ID。
25+
/// </summary>
26+
[Newtonsoft.Json.JsonProperty("sku_id")]
27+
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))]
28+
[System.Text.Json.Serialization.JsonPropertyName("sku_id")]
29+
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString)]
30+
public long SKUId { get; set; }
31+
32+
/// <summary>
33+
/// 获取或设置商品数量。
34+
/// </summary>
35+
[Newtonsoft.Json.JsonProperty("product_cnt")]
36+
[System.Text.Json.Serialization.JsonPropertyName("product_cnt")]
37+
public int Count { get; set; }
38+
}
39+
}
40+
41+
/// <summary>
42+
/// 获取或设置订单 ID。
43+
/// </summary>
44+
[Newtonsoft.Json.JsonProperty("order_id")]
45+
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
46+
public string OrderId { get; set; } = string.Empty;
47+
48+
/// <summary>
49+
/// 获取或设置供货商 AppId。
50+
/// </summary>
51+
[Newtonsoft.Json.JsonProperty("supplier_appid")]
52+
[System.Text.Json.Serialization.JsonPropertyName("supplier_appid")]
53+
public string SupplierAppId { get; set; } = string.Empty;
54+
55+
/// <summary>
56+
/// 获取或设置代发商品列表。
57+
/// </summary>
58+
[Newtonsoft.Json.JsonProperty("dropship_product_list")]
59+
[System.Text.Json.Serialization.JsonPropertyName("dropship_product_list")]
60+
public IList<Types.DropshipProduct> DropshipProductList { get; set; } = new List<Types.DropshipProduct>();
61+
}
62+
}

0 commit comments

Comments
 (0)