Skip to content

Commit

Permalink
feat(tiktokshop): 新增 Webhook 相关事件模型及工具方法
Browse files Browse the repository at this point in the history
  • Loading branch information
fudiwei committed May 14, 2024
1 parent 620183d commit 9694364
Show file tree
Hide file tree
Showing 26 changed files with 685 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Events
{
/// <summary>
/// <para>表示 CANCELLATION_STATUS_CHANGE 事件。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://partner.tiktokshop.com/docv2/page/65030150746462028285f657 ]]>
/// </para>
/// </summary>
public class CancellationStatusChangeEvent : TikTokShopEvent<CancellationStatusChangeEvent.Types.Data>
{
public static class Types
{
public class Data
{
/// <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 OrderId { get; set; } = default!;

/// <summary>
/// 获取或设置取消 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("cancel_id")]
[System.Text.Json.Serialization.JsonPropertyName("cancel_id")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))]
public string CancelId { get; set; } = default!;

/// <summary>
/// 获取或设置取消发起人。
/// </summary>
[Newtonsoft.Json.JsonProperty("cancellations_role")]
[System.Text.Json.Serialization.JsonPropertyName("cancellations_role")]
public string CancelRole { get; set; } = default!;

/// <summary>
/// 获取或设置取消状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("cancel_status")]
[System.Text.Json.Serialization.JsonPropertyName("cancel_status")]
public string CancelStatus { get; set; } = default!;

/// <summary>
/// 获取或设置创建时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("create_time")]
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
public long CreateTimestamp { get; set; }
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Events
{
/// <summary>
/// <para>表示 ORDER_STATUS_CHANGE 事件。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://partner.tiktokshop.com/docv2/page/650300b8a57708028b430b4a ]]>
/// </para>
/// </summary>
public class OrderStatusChangeEvent : TikTokShopEvent<OrderStatusChangeEvent.Types.Data>
{
public static class Types
{
public class Data
{
/// <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 OrderId { get; set; } = default!;

/// <summary>
/// 获取或设置订单状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("order_status")]
[System.Text.Json.Serialization.JsonPropertyName("order_status")]
public string OrderStatus { get; set; } = default!;

/// <summary>
/// 获取或设置更新时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time")]
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
public long UpdateTimestamp { get; set; }

/// <summary>
/// 获取或设置是否是延期订单。
/// </summary>
[Newtonsoft.Json.JsonProperty("is_on_hold_order")]
[System.Text.Json.Serialization.JsonPropertyName("is_on_hold_order")]
public bool? IsOnHoldOrder { get; set; }
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Events
{
/// <summary>
/// <para>表示 PACKAGE_UPDATE 事件。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://partner.tiktokshop.com/docv2/page/650955cabace3e02b73cc886 ]]>
/// </para>
/// </summary>
public class PackageUpdateEvent : TikTokShopEvent<PackageUpdateEvent.Types.Data>
{
public static class Types
{
public class Data
{
public static class Types
{
public class Package
{
/// <summary>
/// 获取或设置包裹 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("package_id")]
[System.Text.Json.Serialization.JsonPropertyName("package_id")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))]
public string? PackageId { get; set; }

/// <summary>
/// 获取或设置订单 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("order_id_list")]
[System.Text.Json.Serialization.JsonPropertyName("order_id_list")]
public string[]? OrderIdList { get; set; }
}
}

/// <summary>
/// 获取或设置事件类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("sc_type")]
[System.Text.Json.Serialization.JsonPropertyName("sc_type")]
public string Type { get; set; } = default!;

/// <summary>
/// 获取或设置角色类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("role_type")]
[System.Text.Json.Serialization.JsonPropertyName("role_type")]
public string RoleType { get; set; } = default!;

/// <summary>
/// 获取或设置包裹列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("package_list")]
[System.Text.Json.Serialization.JsonPropertyName("package_list")]
public Types.Package[] PackageList { get; set; } = default!;

/// <summary>
/// 获取或设置更新时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time")]
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
public long UpdateTimestamp { get; set; }
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Events
{
/// <summary>
/// <para>表示 PRODUCT_CREATION 事件。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://partner.tiktokshop.com/docv2/page/663c98b566828e02e4515580 ]]>
/// </para>
/// </summary>
public class ProductCreationEvent : TikTokShopEvent<ProductCreationEvent.Types.Data>
{
public static class Types
{
public class Data
{
/// <summary>
/// 获取或设置商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_id")]
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))]
public string ProductId { get; set; } = default!;

/// <summary>
/// 获取或设置商品类型列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_type")]
[System.Text.Json.Serialization.JsonPropertyName("product_type")]
public string[] ProductTypeList { get; set; } = default!;

/// <summary>
/// 获取或设置更新时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time")]
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
public long UpdateTimestamp { get; set; }
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Events
{
/// <summary>
/// <para>表示 PRODUCT_INFORMATION_CHANGE 事件。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://partner.tiktokshop.com/docv2/page/65d6f41411a60f02dc1cf8bf ]]>
/// </para>
/// </summary>
public class ProductInformationChangeEvent : TikTokShopEvent<ProductInformationChangeEvent.Types.Data>
{
public static class Types
{
public class Data
{
/// <summary>
/// 获取或设置商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_id")]
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))]
public string ProductId { get; set; } = default!;

/// <summary>
/// 获取或设置修改过的字段列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("changed_fields")]
[System.Text.Json.Serialization.JsonPropertyName("changed_fields")]
public string[] ChangedFieldList { get; set; } = default!;

/// <summary>
/// 获取或设置更新时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time")]
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
public long UpdateTimestamp { get; set; }
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Events
{
/// <summary>
/// <para>表示 PRODUCT_STATUS_CHANGE 事件。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://partner.tiktokshop.com/docv2/page/650956aff1fd3102b90b6261 ]]>
/// </para>
/// </summary>
public class ProductStatusChangeEvent : TikTokShopEvent<ProductStatusChangeEvent.Types.Data>
{
public static class Types
{
public class Data
{
/// <summary>
/// 获取或设置商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_id")]
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))]
public string ProductId { get; set; } = default!;

/// <summary>
/// 获取或设置商品状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("status")]
[System.Text.Json.Serialization.JsonPropertyName("status")]
public string ProductStatus { get; set; } = default!;

/// <summary>
/// 获取或设置审核拒绝原因。
/// </summary>
[Newtonsoft.Json.JsonProperty("suspended_reason")]
[System.Text.Json.Serialization.JsonPropertyName("suspended_reason")]
public string? RejectReason { get; set; }

/// <summary>
/// 获取或设置更新时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time")]
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
public long UpdateTimestamp { get; set; }
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Events
{
/// <summary>
/// <para>表示 RECIPIENT_ADDRESS_UPDATE 事件。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://partner.tiktokshop.com/docv2/page/650301af5a12ff0294ea3bf9 ]]>
/// </para>
/// </summary>
public class RecipientAddressUpdateEvent : TikTokShopEvent<RecipientAddressUpdateEvent.Types.Data>
{
public static class Types
{
public class Data
{
/// <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 OrderId { get; set; } = default!;

/// <summary>
/// 获取或设置更新时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time")]
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
public long UpdateTimestamp { get; set; }
}
}
}
}
Loading

0 comments on commit 9694364

Please sign in to comment.