feat(wxapi): 随官方更新视频号小店商品分类相关接口模型

This commit is contained in:
Fu Diwei
2024-11-04 21:02:36 +08:00
parent bbe04ba535
commit 949c3cd886
20 changed files with 262 additions and 27 deletions

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
@@ -13,6 +14,16 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
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>
@@ -27,23 +38,33 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// <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 列表。

View File

@@ -49,6 +49,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[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
@@ -141,8 +148,16 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// <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!;
}
}

View File

@@ -1,3 +1,5 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
@@ -31,14 +33,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[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!;
}
}

View File

@@ -60,7 +60,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
public string Type { get; set; } = default!;
/// <summary>
/// 获取或设置新版属性类型(后续将替代 <see cref="Type"/> 字段)
/// 获取或设置新版属性类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type_v2")]
[System.Text.Json.Serialization.JsonPropertyName("type_v2")]

View File

@@ -1,3 +1,5 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
@@ -34,9 +36,17 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// <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; }
}
}

View File

@@ -1,3 +1,5 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
@@ -55,9 +57,17 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// <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; }
}
}

View File

@@ -383,9 +383,17 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// <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>
/// 获取或设置商品属性列表。

View File

@@ -412,9 +412,17 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// <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>
/// 获取或设置商品属性列表。

View File

@@ -167,9 +167,17 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// <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>
/// 获取或设置商品属性列表。

View File

@@ -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>
@@ -18,5 +18,12 @@
[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; }
}
}

View File

@@ -1,3 +1,5 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
@@ -157,10 +159,19 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// <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>
/// 获取或设置商品状态。