Skip to content

Commit

Permalink
feat(wxapi): 随官方更新视频号小店商品分类相关接口模型
Browse files Browse the repository at this point in the history
  • Loading branch information
fudiwei committed Nov 4, 2024
1 parent bbe04ba commit 949c3cd
Show file tree
Hide file tree
Showing 20 changed files with 262 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;

namespace SKIT.FlurlHttpClient.Wechat.Api.Models
Expand All @@ -13,6 +14,16 @@ public class Category
{
public static class Types
{
public class Category
{
/// <summary>
/// 获取或设置分类 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("cat_id")]
[System.Text.Json.Serialization.JsonPropertyName("cat_id")]
public long CategoryId { get; set; }
}

public class Brand
{
/// <summary>
Expand All @@ -27,23 +38,33 @@ public class Brand
/// <summary>
/// 获取或设置一级类目 ID。
/// </summary>
[Obsolete("相关接口或字段于 2024-10-28 下线。")]
[Newtonsoft.Json.JsonProperty("level1")]
[System.Text.Json.Serialization.JsonPropertyName("level1")]
public long FirstCategoryId { get; set; }
public long? FirstCategoryId { get; set; }

/// <summary>
/// 获取或设置二级类目 ID。
/// </summary>
[Obsolete("相关接口或字段于 2024-10-28 下线。")]
[Newtonsoft.Json.JsonProperty("level2")]
[System.Text.Json.Serialization.JsonPropertyName("level2")]
public long SecondCategoryId { get; set; }
public long? SecondCategoryId { get; set; }

/// <summary>
/// 获取或设置三级类目 ID。
/// </summary>
[Obsolete("相关接口或字段于 2024-10-28 下线。")]
[Newtonsoft.Json.JsonProperty("level3")]
[System.Text.Json.Serialization.JsonPropertyName("level3")]
public long ThirdCategoryId { get; set; }
public long? ThirdCategoryId { get; set; }

/// <summary>
/// 获取或设置新版分类列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("cats_v2")]
[System.Text.Json.Serialization.JsonPropertyName("cats_v2")]
public IList<Types.Category>? CategoryV2List { get; set; }

/// <summary>
/// 获取或设置资质材料图片 MediaId 列表。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ public class Category
[System.Text.Json.Serialization.JsonPropertyName("level")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public int Level { get; set; }

/// <summary>
/// 获取或设置是否是叶子节点。
/// </summary>
[Newtonsoft.Json.JsonProperty("leaf")]
[System.Text.Json.Serialization.JsonPropertyName("leaf")]
public bool? IsLeaf { get; set; }
}

public class Qualification
Expand Down Expand Up @@ -141,8 +148,16 @@ public class Qualification
/// <summary>
/// 获取或设置类目列表。
/// </summary>
[Obsolete("相关接口或字段于 2024-10-28 下线。")]
[Newtonsoft.Json.JsonProperty("cats")]
[System.Text.Json.Serialization.JsonPropertyName("cats")]
public Types.Category[] CategoryList { get; set; } = default!;

/// <summary>
/// 获取或设置新版类目列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("cats_v2")]
[System.Text.Json.Serialization.JsonPropertyName("cats_v2")]
public Types.Category[] CategoryV2List { get; set; } = default!;
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System;

namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
Expand Down Expand Up @@ -31,14 +33,29 @@ public class Category
[System.Text.Json.Serialization.JsonPropertyName("f_cat_id")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long ParentCategoryId { get; set; }

/// <summary>
/// 获取或设置是否是叶子节点。
/// </summary>
[Newtonsoft.Json.JsonProperty("leaf")]
[System.Text.Json.Serialization.JsonPropertyName("leaf")]
public bool? IsLeaf { get; set; }
}
}

/// <summary>
/// 获取或设置类目列表。
/// </summary>
[Obsolete("相关接口或字段于 2024-10-28 下线。")]
[Newtonsoft.Json.JsonProperty("cat_list")]
[System.Text.Json.Serialization.JsonPropertyName("cat_list")]
public Types.Category[] CategoryList { get; set; } = default!;

/// <summary>
/// 获取或设置新版类目列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("cat_list_v2")]
[System.Text.Json.Serialization.JsonPropertyName("cat_list_v2")]
public Types.Category[] CategoryV2List { get; set; } = default!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class ProductAttribute
public string Type { get; set; } = default!;

/// <summary>
/// 获取或设置新版属性类型(后续将替代 <see cref="Type"/> 字段)
/// 获取或设置新版属性类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type_v2")]
[System.Text.Json.Serialization.JsonPropertyName("type_v2")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System;

namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
Expand Down Expand Up @@ -34,9 +36,17 @@ public class Category : ChannelsECLeagueHeadSupplierWindowGetDetailResponse.Type
/// <summary>
/// 获取或设置商品类目列表。
/// </summary>
[Obsolete("相关接口或字段于 2024-10-28 下线。")]
[Newtonsoft.Json.JsonProperty("cats")]
[System.Text.Json.Serialization.JsonPropertyName("cats")]
public new Types.Category[] CategoryList { get; set; } = default!;
public new Types.Category[]? CategoryList { get; set; }

/// <summary>
/// 获取或设置新版商品类目列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("cats_v2")]
[System.Text.Json.Serialization.JsonPropertyName("cats_v2")]
public Types.Category[]? CategoryV2List { get; set; }
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System;

namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
Expand Down Expand Up @@ -55,9 +57,17 @@ public class Category : ChannelsECProductGetResponse.Types.Product.Types.Categor
/// <summary>
/// 获取或设置商品类目列表。
/// </summary>
[Obsolete("相关接口或字段于 2024-10-28 下线。")]
[Newtonsoft.Json.JsonProperty("cats")]
[System.Text.Json.Serialization.JsonPropertyName("cats")]
public Types.Category[] CategoryList { get; set; } = default!;
public Types.Category[]? CategoryList { get; set; } = default!;

/// <summary>
/// 获取或设置新版商品类目列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("cats_v2")]
[System.Text.Json.Serialization.JsonPropertyName("cats_v2")]
public Types.Category[]? CategoryV2List { get; set; }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,17 @@ public class SpecificationValue
/// <summary>
/// 获取或设置商品类目列表。
/// </summary>
[Obsolete("相关接口或字段于 2024-10-28 下线。")]
[Newtonsoft.Json.JsonProperty("cats")]
[System.Text.Json.Serialization.JsonPropertyName("cats")]
public IList<Types.Category> CategoryList { get; set; } = new List<Types.Category>();
public IList<Types.Category>? CategoryList { get; set; }

/// <summary>
/// 获取或设置新版商品类目列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("cats_v2")]
[System.Text.Json.Serialization.JsonPropertyName("cats_v2")]
public IList<Types.Category>? CategoryV2List { get; set; }

/// <summary>
/// 获取或设置商品属性列表。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,17 @@ public class SpecificationValue
/// <summary>
/// 获取或设置商品类目列表。
/// </summary>
[Obsolete("相关接口或字段于 2024-10-28 下线。")]
[Newtonsoft.Json.JsonProperty("cats")]
[System.Text.Json.Serialization.JsonPropertyName("cats")]
public Types.Category[] CategoryList { get; set; } = default!;
public Types.Category[]? CategoryList { get; set; }

/// <summary>
/// 获取或设置新版商品类目列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("cats_v2")]
[System.Text.Json.Serialization.JsonPropertyName("cats_v2")]
public Types.Category[]? CategoryV2List { get; set; }

/// <summary>
/// 获取或设置商品属性列表。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,17 @@ public class SpecificationValue : ChannelsECProductAddRequest.Types.SizeChart.Ty
/// <summary>
/// 获取或设置商品类目列表。
/// </summary>
[Obsolete("相关接口或字段于 2024-10-28 下线。")]
[Newtonsoft.Json.JsonProperty("cats")]
[System.Text.Json.Serialization.JsonPropertyName("cats")]
public IList<Types.Category> CategoryList { get; set; } = new List<Types.Category>();
public IList<Types.Category>? CategoryList { get; set; }

/// <summary>
/// 获取或设置新版商品类目列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("cats_v2")]
[System.Text.Json.Serialization.JsonPropertyName("cats_v2")]
public IList<Types.Category>? CategoryV2List { get; set; }

/// <summary>
/// 获取或设置商品属性列表。
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/window/product/get 接口的请求。</para>
Expand All @@ -18,5 +18,12 @@ public class ChannelsECWindowProductGetRequest : WechatApiRequest, IInferable<Ch
[Newtonsoft.Json.JsonProperty("appid")]
[System.Text.Json.Serialization.JsonPropertyName("appid")]
public string AppId { get; set; } = string.Empty;

/// <summary>
/// 获取或设置是否查询带货商品。
/// </summary>
[Newtonsoft.Json.JsonProperty("need_cps_product")]
[System.Text.Json.Serialization.JsonPropertyName("need_cps_product")]
public bool? RequireCPSProduct { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System;

namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
Expand Down Expand Up @@ -157,10 +159,19 @@ public class LimitedDiscount
/// <summary>
/// 获取或设置商品三级类目 ID。
/// </summary>
[Obsolete("相关接口或字段于 2024-10-28 下线。")]
[Newtonsoft.Json.JsonProperty("third_category_id")]
[System.Text.Json.Serialization.JsonPropertyName("third_category_id")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long ThirdCategoryId { get; set; }
public long? ThirdCategoryId { get; set; }

/// <summary>
/// 获取或设置新版商品三级类目 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("leaf_category_id")]
[System.Text.Json.Serialization.JsonPropertyName("leaf_category_id")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long? LeafCategoryId { get; set; }

/// <summary>
/// 获取或设置商品状态。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,24 @@
"level1": 7419,
"level2": 7439,
"level3": 7448,
"certificate": [ "THE_MEDIA_ID_1", "THE_MEDIA_ID_2" ],
"cats_v2": [
{
"cat_id": 6033
},
{
"cat_id": 6057
},
{
"cat_id": 6091
},
{
"cat_id": 6093
}
],
"certificate": [
"THE_MEDIA_ID_1",
"THE_MEDIA_ID_2"
],
"brand_list": [
{ "brand_id": 1001 },
{ "brand_id": 1002 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@
"level": 3
},
"qua": {
"qua_id": "0",
"need_to_apply": true,
"tips": "",
"mandatory": true
},
"product_qua": {
"qua_id": "0",
"need_to_apply": true,
"tips": "",
"mandatory": true
},
"brand_qua": {
"qua_id": "0",
"need_to_apply": true,
"tips": "",
"mandatory": true
Expand Down Expand Up @@ -71,5 +68,59 @@
}
]
}
],
"cats_v2": [
{
"cat_and_qua": [
{
"cat": {
"cat_id": "545709",
"name": "公路电子收费/ETC/OBU",
"f_cat_id": "10000131",
"level": 3,
"leaf": true
},
"qua": {
"qua_id": "1111608",
"need_to_apply": true,
"tips": "1、主体要求\n(1)入驻主体类型仅限于企业。\n(2)开店主体公司注册资本不低于100万,注册时间不少于1年。\n\n2、行业资质\n(1)交通运输部指定全国各省份的ETC发行机构或合作机构。需提交交通部或交通厅关于ETC发行服务机构的信息公开单位证明截图,或同等效力的证明材料;参考示例:《证明材料示例》https://docs.qq.com/doc/DVXBuUHpPSFdmYmJW\n(2)需提交关于合法合规经营产品的承诺函。承诺函模板:https://docs.qq.com/doc/p/68313cd4ca24c6f0577d5ed3578c906ae9d67c91",
"mandatory": true
},
"brand_qua": {
"qua_id": "1111609",
"need_to_apply": true,
"tips": "1、属于品牌商标权利人/一级授权经销商。\n2、品牌须在京东有开设自营旗舰店/自营官方旗舰店或在天猫有开设官方旗舰店店铺;\n3、品牌须在在京东开设的自营旗舰店/自营官方旗舰店或在天猫开设的官方旗舰店店铺主营类目需和申请视频号橱窗定向准入的类目一致,请提供相应截图。\n4、品牌商标注册证需包含所申请范围",
"mandatory": true
},
"product_qua_list": [

]
},
{
"cat": {
"cat_id": "10000131",
"name": "车载电器",
"f_cat_id": "10000126",
"level": 2,
"leaf": false
},
"product_qua_list": [

]
},
{
"cat": {
"cat_id": "10000126",
"name": "汽车",
"f_cat_id": "0",
"level": 1,
"leaf": false
},
"product_qua_list": [

]
}
]
}
]
}
Loading

0 comments on commit 949c3cd

Please sign in to comment.