Skip to content

Commit 9fbfcdc

Browse files
committed
feat(wxapi): 新增微信小店达人推广商品相关接口
1 parent c414aba commit 9fbfcdc

28 files changed

Lines changed: 1159 additions & 21 deletions

File tree

src/SKIT.FlurlHttpClient.Wechat.Api/Events/Channels/EC/ChannelsECHeadSupplierItemUpdateEvent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
44
/// <para>表示 EVENT.head_supplier_item_update 事件的数据。</para>
55
/// <para>
66
/// REF: <br/>
7-
/// <![CDATA[ https://developers.weixin.qq.com/doc/channels/API/leagueheadsupplier/callback/head_supplier_item_update.html ]]>
7+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/leagueheadsupplier/API/callback/head_supplier_item_update.html ]]>
88
/// </para>
99
/// </summary>
1010
public class ChannelsECHeadSupplierItemUpdateEvent : WechatApiEvent

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

Lines changed: 184 additions & 15 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [POST] /channels/ec/league/headsupplier/cooperativeitem/add 接口的请求。</para>
5+
/// </summary>
6+
public class ChannelsECLeagueHeadSupplierCooperativeItemAddRequest : WechatApiRequest, IInferable<ChannelsECLeagueHeadSupplierCooperativeItemAddRequest, ChannelsECLeagueHeadSupplierCooperativeItemAddResponse>
7+
{
8+
/// <summary>
9+
/// 获取或设置机构推广商品链接。
10+
/// </summary>
11+
[Newtonsoft.Json.JsonProperty("head_supplier_item_link")]
12+
[System.Text.Json.Serialization.JsonPropertyName("head_supplier_item_link")]
13+
public string HeadSupplierItemLink { get; set; } = string.Empty;
14+
15+
/// <summary>
16+
/// 获取或设置是否隐藏。
17+
/// </summary>
18+
[Newtonsoft.Json.JsonProperty("hidden_flag")]
19+
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.NumericalBooleanConverter))]
20+
[System.Text.Json.Serialization.JsonPropertyName("hidden_flag")]
21+
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalBooleanConverter))]
22+
public bool? IsHidden { get; set; }
23+
}
24+
}
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/league/headsupplier/cooperativeitem/add 接口的响应。</para>
5+
/// </summary>
6+
public class ChannelsECLeagueHeadSupplierCooperativeItemAddResponse : WechatApiResponse
7+
{
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [POST] /channels/ec/league/headsupplier/cooperativeitem/list/get 接口的请求。</para>
5+
/// </summary>
6+
public class ChannelsECLeagueHeadSupplierCooperativeItemListGetRequest : WechatApiRequest, IInferable<ChannelsECLeagueHeadSupplierCooperativeItemListGetRequest, ChannelsECLeagueHeadSupplierCooperativeItemListGetResponse>
7+
{
8+
/// <summary>
9+
/// 获取或设置佣金分配类型。
10+
/// </summary>
11+
[Newtonsoft.Json.JsonProperty("commission_type")]
12+
[System.Text.Json.Serialization.JsonPropertyName("commission_type")]
13+
public int CommissionType { get; set; }
14+
15+
/// <summary>
16+
/// 获取或设置分页每页数量。
17+
/// <para>默认值:10</para>
18+
/// </summary>
19+
[Newtonsoft.Json.JsonProperty("page_size")]
20+
[System.Text.Json.Serialization.JsonPropertyName("page_size")]
21+
public int Limit { get; set; } = 10;
22+
23+
/// <summary>
24+
/// 获取或设置翻页标记。
25+
/// </summary>
26+
[Newtonsoft.Json.JsonProperty("next_key")]
27+
[System.Text.Json.Serialization.JsonPropertyName("next_key")]
28+
public string? Cursor { get; set; }
29+
}
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [POST] /channels/ec/league/headsupplier/cooperativeitem/list/get 接口的响应。</para>
5+
/// </summary>
6+
public class ChannelsECLeagueHeadSupplierCooperativeItemListGetResponse : WechatApiResponse
7+
{
8+
public static class Types
9+
{
10+
public class CooperativeItem
11+
{
12+
/// <summary>
13+
/// 获取或设置合作商品 ID。
14+
/// </summary>
15+
[Newtonsoft.Json.JsonProperty("product_id")]
16+
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
17+
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
18+
public long CooperativeItemId { get; set; }
19+
20+
/// <summary>
21+
/// 获取或设置合作计划 ID。
22+
/// </summary>
23+
[Newtonsoft.Json.JsonProperty("id")]
24+
[System.Text.Json.Serialization.JsonPropertyName("id")]
25+
public long PlanId { get; set; }
26+
27+
/// <summary>
28+
/// 获取或设置计划链接。
29+
/// </summary>
30+
[Newtonsoft.Json.JsonProperty("head_supplier_item_link")]
31+
[System.Text.Json.Serialization.JsonPropertyName("head_supplier_item_link")]
32+
public string HeadSupplierItemLink { get; set; } = default!;
33+
}
34+
}
35+
36+
/// <summary>
37+
/// 获取或设置合作商品列表。
38+
/// </summary>
39+
[Newtonsoft.Json.JsonProperty("list")]
40+
[System.Text.Json.Serialization.JsonPropertyName("list")]
41+
public Types.CooperativeItem[] CooperativeItemList { get; set; } = default!;
42+
43+
/// <summary>
44+
/// 获取或设置翻页标记。
45+
/// </summary>
46+
[Newtonsoft.Json.JsonProperty("next_key")]
47+
[System.Text.Json.Serialization.JsonPropertyName("next_key")]
48+
public string? NextCursor { get; set; }
49+
}
50+
}

src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLeague/HeadSupplier/Item/ChannelsECLeagueHeadSupplierItemGetResponse.cs

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ public class Product
1313
{
1414
public static class Types
1515
{
16-
public class ProductInfo : ChannelsECLeagueHeadSupplierWindowGetDetailResponse.Types.Product.Types.ProductInfo
16+
public class ProductInfo
1717
{
18-
public static new class Types
18+
public static class Types
1919
{
2020
public class Detail : ChannelsECLeagueHeadSupplierWindowGetDetailResponse.Types.Product.Types.ProductInfo.Types.Detail
2121
{
@@ -26,27 +26,48 @@ public class Category : ChannelsECLeagueHeadSupplierWindowGetDetailResponse.Type
2626
}
2727
}
2828

29+
/// <summary>
30+
/// 获取或设置商品标题。
31+
/// </summary>
32+
[Newtonsoft.Json.JsonProperty("title")]
33+
[System.Text.Json.Serialization.JsonPropertyName("title")]
34+
public string Title { get; set; } = default!;
35+
36+
/// <summary>
37+
/// 获取或设置商品副标题。
38+
/// </summary>
39+
[Newtonsoft.Json.JsonProperty("sub_title")]
40+
[System.Text.Json.Serialization.JsonPropertyName("sub_title")]
41+
public string? SubTitle { get; set; }
42+
43+
/// <summary>
44+
/// 获取或设置主图 URL 列表。
45+
/// </summary>
46+
[Newtonsoft.Json.JsonProperty("head_imgs")]
47+
[System.Text.Json.Serialization.JsonPropertyName("head_imgs")]
48+
public string[] HeadImageUrlList { get; set; } = default!;
49+
2950
/// <summary>
3051
/// 获取或设置商品详情信息。
3152
/// </summary>
3253
[Newtonsoft.Json.JsonProperty("desc_info")]
3354
[System.Text.Json.Serialization.JsonPropertyName("desc_info")]
34-
public new Types.Detail Detail { get; set; } = default!;
55+
public Types.Detail Detail { get; set; } = default!;
3556

3657
/// <summary>
3758
/// 获取或设置商品类目列表。
3859
/// </summary>
3960
[Obsolete("相关接口或字段于 2024-10-28 下线。")]
4061
[Newtonsoft.Json.JsonProperty("cats")]
4162
[System.Text.Json.Serialization.JsonPropertyName("cats")]
42-
public new Types.Category[]? CategoryList { get; set; }
63+
public Types.Category[]? CategoryList { get; set; }
4364

4465
/// <summary>
4566
/// 获取或设置新版商品类目列表。
4667
/// </summary>
4768
[Newtonsoft.Json.JsonProperty("cats_v2")]
4869
[System.Text.Json.Serialization.JsonPropertyName("cats_v2")]
49-
public new Types.Category[]? CategoryV2List { get; set; }
70+
public Types.Category[]? CategoryV2List { get; set; }
5071
}
5172
}
5273

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [POST] /channels/ec/league/headsupplier/item/promotiondetail/get 接口的请求。</para>
5+
/// </summary>
6+
public class ChannelsECLeagueHeadSupplierItemPromotionDetailGetRequest : WechatApiRequest, IInferable<ChannelsECLeagueHeadSupplierItemPromotionDetailGetRequest, ChannelsECLeagueHeadSupplierItemPromotionDetailGetResponse>
7+
{
8+
/// <summary>
9+
/// 获取或设置团长商品链接。
10+
/// </summary>
11+
[Newtonsoft.Json.JsonProperty("head_supplier_item_link")]
12+
[System.Text.Json.Serialization.JsonPropertyName("head_supplier_item_link")]
13+
public string HeadSupplierItemLink { get; set; } = string.Empty;
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [POST] /channels/ec/league/headsupplier/item/promotiondetail/get 接口的响应。</para>
5+
/// </summary>
6+
public class ChannelsECLeagueHeadSupplierItemPromotionDetailGetResponse : WechatApiResponse
7+
{
8+
public static class Types
9+
{
10+
public class Product
11+
{
12+
public static class Types
13+
{
14+
public class CommissionInfo
15+
{
16+
public static class Types
17+
{
18+
public class NormalCommissionInfo
19+
{
20+
/// <summary>
21+
/// 获取或设置佣金费率(单位:十万分数)。
22+
/// </summary>
23+
[Newtonsoft.Json.JsonProperty("ratio")]
24+
[System.Text.Json.Serialization.JsonPropertyName("ratio")]
25+
public int Ratio { get; set; }
26+
}
27+
}
28+
29+
/// <summary>
30+
/// 获取或设置计划类型。
31+
/// </summary>
32+
[Newtonsoft.Json.JsonProperty("plan_type")]
33+
[System.Text.Json.Serialization.JsonPropertyName("plan_type")]
34+
public int PlanType { get; set; }
35+
36+
/// <summary>
37+
/// 获取或设置佣金分配类型。
38+
/// </summary>
39+
[Newtonsoft.Json.JsonProperty("commission_type")]
40+
[System.Text.Json.Serialization.JsonPropertyName("commission_type")]
41+
public int CommissionType { get; set; }
42+
43+
/// <summary>
44+
/// 获取或设置佣金费率(单位:十万分数)。
45+
/// </summary>
46+
[Newtonsoft.Json.JsonProperty("ratio")]
47+
[System.Text.Json.Serialization.JsonPropertyName("ratio")]
48+
public int CommissionRatio { get; set; }
49+
50+
/// <summary>
51+
/// 获取或设置服务费费率(单位:十万分数)。
52+
/// </summary>
53+
[Newtonsoft.Json.JsonProperty("service_ratio")]
54+
[System.Text.Json.Serialization.JsonPropertyName("service_ratio")]
55+
public int ServiceFeeRatio { get; set; }
56+
57+
/// <summary>
58+
/// 获取或设置计划开始时间戳。
59+
/// </summary>
60+
[Newtonsoft.Json.JsonProperty("start_time")]
61+
[System.Text.Json.Serialization.JsonPropertyName("start_time")]
62+
public long StartTimestamp { get; set; }
63+
64+
/// <summary>
65+
/// 获取或设置计划结束时间戳。
66+
/// </summary>
67+
[Newtonsoft.Json.JsonProperty("end_time")]
68+
[System.Text.Json.Serialization.JsonPropertyName("end_time")]
69+
public long EndTimestamp { get; set; }
70+
71+
/// <summary>
72+
/// 获取或设置该商品普通推广下的佣金信息。
73+
/// </summary>
74+
[Newtonsoft.Json.JsonProperty("normal_commission_info")]
75+
[System.Text.Json.Serialization.JsonPropertyName("normal_commission_info")]
76+
public Types.NormalCommissionInfo? NormalCommissionInfo { get; set; }
77+
}
78+
79+
public class HeadSupplierInfo
80+
{
81+
/// <summary>
82+
/// 获取或设置团长 AppId。
83+
/// </summary>
84+
[Newtonsoft.Json.JsonProperty("appid")]
85+
[System.Text.Json.Serialization.JsonPropertyName("appid")]
86+
public string AppId { get; set; } = default!;
87+
88+
/// <summary>
89+
/// 获取或设置团长名称。
90+
/// </summary>
91+
[Newtonsoft.Json.JsonProperty("name")]
92+
[System.Text.Json.Serialization.JsonPropertyName("name")]
93+
public string Name { get; set; } = default!;
94+
}
95+
96+
public class CooperativeInfo
97+
{
98+
/// <summary>
99+
/// 获取或设置合作状态。
100+
/// </summary>
101+
[Newtonsoft.Json.JsonProperty("cooperative_status")]
102+
[System.Text.Json.Serialization.JsonPropertyName("cooperative_status")]
103+
public int CooperativeStatus { get; set; }
104+
105+
/// <summary>
106+
/// 获取或设置是否隐藏。
107+
/// </summary>
108+
[Newtonsoft.Json.JsonProperty("is_hidden")]
109+
[System.Text.Json.Serialization.JsonPropertyName("is_hidden")]
110+
public bool IsHidden { get; set; }
111+
112+
/// <summary>
113+
/// 获取或设置带货链接。
114+
/// </summary>
115+
[Newtonsoft.Json.JsonProperty("link")]
116+
[System.Text.Json.Serialization.JsonPropertyName("link")]
117+
public string? Link { get; set; }
118+
}
119+
}
120+
121+
/// <summary>
122+
/// 获取或设置小店 AppId。
123+
/// </summary>
124+
[Newtonsoft.Json.JsonProperty("shop_appid")]
125+
[System.Text.Json.Serialization.JsonPropertyName("shop_appid")]
126+
public string AppId { get; set; } = default!;
127+
128+
/// <summary>
129+
/// 获取或设置商品 ID。
130+
/// </summary>
131+
[Newtonsoft.Json.JsonProperty("product_id")]
132+
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
133+
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
134+
public long ProductId { get; set; }
135+
136+
/// <summary>
137+
/// 获取或设置商品来源。
138+
/// </summary>
139+
[Newtonsoft.Json.JsonProperty("spu_source")]
140+
[System.Text.Json.Serialization.JsonPropertyName("spu_source")]
141+
public int SPUSource { get; set; }
142+
143+
/// <summary>
144+
/// 获取或设置佣金信息。
145+
/// </summary>
146+
[Newtonsoft.Json.JsonProperty("commission_info")]
147+
[System.Text.Json.Serialization.JsonPropertyName("commission_info")]
148+
public Types.CommissionInfo CommissionInfo { get; set; } = default!;
149+
150+
/// <summary>
151+
/// 获取或设置供货机构信息。
152+
/// </summary>
153+
[Newtonsoft.Json.JsonProperty("head_supplier_info")]
154+
[System.Text.Json.Serialization.JsonPropertyName("head_supplier_info")]
155+
public Types.HeadSupplierInfo HeadSupplierInfo { get; set; } = default!;
156+
157+
/// <summary>
158+
/// 获取或设置合作信息。
159+
/// </summary>
160+
[Newtonsoft.Json.JsonProperty("cooperative_info")]
161+
[System.Text.Json.Serialization.JsonPropertyName("cooperative_info")]
162+
public Types.CooperativeInfo CooperativeInfo { get; set; } = default!;
163+
}
164+
}
165+
166+
/// <summary>
167+
/// 获取或设置商品信息。
168+
/// </summary>
169+
[Newtonsoft.Json.JsonProperty("item")]
170+
[System.Text.Json.Serialization.JsonPropertyName("item")]
171+
public Types.Product Product { get; set; } = default!;
172+
}
173+
}

0 commit comments

Comments
 (0)