From 86f2f11bdb281f5445e534dbd4e21713d991e5a0 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Tue, 12 Apr 2022 16:51:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(wxapi):=20=E6=96=B0=E5=A2=9E=E9=83=A8?= =?UTF-8?q?=E5=88=86=E8=87=AA=E5=AE=9A=E4=B9=89=E4=BA=A4=E6=98=93=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9B=B8=E5=85=B3=E5=9B=9E=E8=B0=83=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OpenProduct/AftersaleNewOrderEvent.cs | 47 +++++++++++++++++++ .../AftersaleRefundSuccessEvent.cs | 39 +++++++++++++++ .../OpenProduct/AftersaleUserCancelEvent.cs | 39 +++++++++++++++ ...ftersaleWaitMerchantConfirmReceiptEvent.cs | 39 +++++++++++++++ ...AftersaleWaitMerchantOfflineRefundEvent.cs | 39 +++++++++++++++ .../OpenProduct/ComplaintNotifyEvent.cs | 47 +++++++++++++++++++ .../Complaint/ShopComplaintGetListResponse.cs | 14 +++--- .../OpenProduct/AftersaleNewOrderEvent.xml | 12 +++++ .../AftersaleRefundSuccessEvent.xml | 11 +++++ .../OpenProduct/AftersaleUserCancelEvent.xml | 11 +++++ ...tersaleWaitMerchantConfirmReceiptEvent.xml | 11 +++++ ...ftersaleWaitMerchantOfflineRefundEvent.xml | 11 +++++ .../OpenProduct/ComplaintNotifyEvent.xml | 12 +++++ 13 files changed, 325 insertions(+), 7 deletions(-) create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleNewOrderEvent.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleRefundSuccessEvent.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleUserCancelEvent.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleWaitMerchantConfirmReceiptEvent.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleWaitMerchantOfflineRefundEvent.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/ComplaintNotifyEvent.cs create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleNewOrderEvent.xml create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleRefundSuccessEvent.xml create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleUserCancelEvent.xml create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleWaitMerchantConfirmReceiptEvent.xml create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleWaitMerchantOfflineRefundEvent.xml create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/ComplaintNotifyEvent.xml diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleNewOrderEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleNewOrderEvent.cs new file mode 100644 index 00000000..e1b47e3f --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleNewOrderEvent.cs @@ -0,0 +1,47 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Events +{ + /// + /// 表示 EVENT.aftersale_new_order 事件的数据。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/callback/aftersale/aftersale_new_order.html + /// + public class AftersaleNewOrderEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable + { + public static class Types + { + public class AftersaleOrder + { + /// + /// 获取或设置售后单号。 + /// + [Newtonsoft.Json.JsonProperty("aftersale_id")] + [System.Text.Json.Serialization.JsonPropertyName("aftersale_id")] + [System.Xml.Serialization.XmlElement("aftersale_id")] + public long AftersaleOrderId { get; set; } + + /// + /// 获取或设置订单号。 + /// + [Newtonsoft.Json.JsonProperty("order_id")] + [System.Text.Json.Serialization.JsonPropertyName("order_id")] + [System.Xml.Serialization.XmlElement("order_id")] + public long OrderId { get; set; } + + /// + /// 获取或设置商家自定义订单号。 + /// + [Newtonsoft.Json.JsonProperty("out_order_id")] + [System.Text.Json.Serialization.JsonPropertyName("out_order_id")] + [System.Xml.Serialization.XmlElement("out_order_id")] + public string OutOrderId { get; set; } = default!; + } + } + + /// + /// 获取或设置售后单信息。 + /// + [Newtonsoft.Json.JsonProperty("aftersale_info")] + [System.Text.Json.Serialization.JsonPropertyName("aftersale_info")] + [System.Xml.Serialization.XmlElement("aftersale_info")] + public Types.AftersaleOrder AftersaleOrder { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleRefundSuccessEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleRefundSuccessEvent.cs new file mode 100644 index 00000000..99688dd9 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleRefundSuccessEvent.cs @@ -0,0 +1,39 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Events +{ + /// + /// 表示 EVENT.aftersale_refund_success 事件的数据。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/callback/aftersale/aftersale_refund_success.html + /// + public class AftersaleRefundSuccessEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable + { + public static class Types + { + public class AftersaleOrder + { + /// + /// 获取或设置售后单号。 + /// + [Newtonsoft.Json.JsonProperty("aftersale_id")] + [System.Text.Json.Serialization.JsonPropertyName("aftersale_id")] + [System.Xml.Serialization.XmlElement("aftersale_id")] + public long AftersaleOrderId { get; set; } + + /// + /// 获取或设置商家自定义售后单号。 + /// + [Newtonsoft.Json.JsonProperty("out_aftersale_id")] + [System.Text.Json.Serialization.JsonPropertyName("out_aftersale_id")] + [System.Xml.Serialization.XmlElement("out_aftersale_id")] + public string OutAftersaleOrderId { get; set; } = default!; + } + } + + /// + /// 获取或设置售后单信息。 + /// + [Newtonsoft.Json.JsonProperty("aftersale_info")] + [System.Text.Json.Serialization.JsonPropertyName("aftersale_info")] + [System.Xml.Serialization.XmlElement("aftersale_info")] + public Types.AftersaleOrder AftersaleOrder { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleUserCancelEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleUserCancelEvent.cs new file mode 100644 index 00000000..99c60978 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleUserCancelEvent.cs @@ -0,0 +1,39 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Events +{ + /// + /// 表示 EVENT.aftersale_user_cancel 事件的数据。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/callback/aftersale/aftersale_user_cancel.html + /// + public class AftersaleUserCancelEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable + { + public static class Types + { + public class AftersaleOrder + { + /// + /// 获取或设置售后单号。 + /// + [Newtonsoft.Json.JsonProperty("aftersale_id")] + [System.Text.Json.Serialization.JsonPropertyName("aftersale_id")] + [System.Xml.Serialization.XmlElement("aftersale_id")] + public long AftersaleOrderId { get; set; } + + /// + /// 获取或设置商家自定义售后单号。 + /// + [Newtonsoft.Json.JsonProperty("out_aftersale_id")] + [System.Text.Json.Serialization.JsonPropertyName("out_aftersale_id")] + [System.Xml.Serialization.XmlElement("out_aftersale_id")] + public string OutAftersaleOrderId { get; set; } = default!; + } + } + + /// + /// 获取或设置售后单信息。 + /// + [Newtonsoft.Json.JsonProperty("aftersale_info")] + [System.Text.Json.Serialization.JsonPropertyName("aftersale_info")] + [System.Xml.Serialization.XmlElement("aftersale_info")] + public Types.AftersaleOrder AftersaleOrder { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleWaitMerchantConfirmReceiptEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleWaitMerchantConfirmReceiptEvent.cs new file mode 100644 index 00000000..ee6a8ba1 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleWaitMerchantConfirmReceiptEvent.cs @@ -0,0 +1,39 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Events +{ + /// + /// 表示 EVENT.aftersale_wait_merchant_confirm_receipt 事件的数据。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/callback/aftersale/aftersale_wait_merchant_confirm_receipt.html + /// + public class AftersaleWaitMerchantConfirmReceiptEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable + { + public static class Types + { + public class AftersaleOrder + { + /// + /// 获取或设置售后单号。 + /// + [Newtonsoft.Json.JsonProperty("aftersale_id")] + [System.Text.Json.Serialization.JsonPropertyName("aftersale_id")] + [System.Xml.Serialization.XmlElement("aftersale_id")] + public long AftersaleOrderId { get; set; } + + /// + /// 获取或设置商家自定义售后单号。 + /// + [Newtonsoft.Json.JsonProperty("out_aftersale_id")] + [System.Text.Json.Serialization.JsonPropertyName("out_aftersale_id")] + [System.Xml.Serialization.XmlElement("out_aftersale_id")] + public string OutAftersaleOrderId { get; set; } = default!; + } + } + + /// + /// 获取或设置售后单信息。 + /// + [Newtonsoft.Json.JsonProperty("aftersale_info")] + [System.Text.Json.Serialization.JsonPropertyName("aftersale_info")] + [System.Xml.Serialization.XmlElement("aftersale_info")] + public Types.AftersaleOrder AftersaleOrder { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleWaitMerchantOfflineRefundEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleWaitMerchantOfflineRefundEvent.cs new file mode 100644 index 00000000..3cfd43e7 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/AftersaleWaitMerchantOfflineRefundEvent.cs @@ -0,0 +1,39 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Events +{ + /// + /// 表示 EVENT.aftersale_wait_merchant_offline_refund 事件的数据。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/callback/aftersale/aftersale_wait_merchant_offline_refund.html + /// + public class AftersaleWaitMerchantOfflineRefundEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable + { + public static class Types + { + public class AftersaleOrder + { + /// + /// 获取或设置售后单号。 + /// + [Newtonsoft.Json.JsonProperty("aftersale_id")] + [System.Text.Json.Serialization.JsonPropertyName("aftersale_id")] + [System.Xml.Serialization.XmlElement("aftersale_id")] + public long AftersaleOrderId { get; set; } + + /// + /// 获取或设置商家自定义售后单号。 + /// + [Newtonsoft.Json.JsonProperty("out_aftersale_id")] + [System.Text.Json.Serialization.JsonPropertyName("out_aftersale_id")] + [System.Xml.Serialization.XmlElement("out_aftersale_id")] + public string OutAftersaleOrderId { get; set; } = default!; + } + } + + /// + /// 获取或设置售后单信息。 + /// + [Newtonsoft.Json.JsonProperty("aftersale_info")] + [System.Text.Json.Serialization.JsonPropertyName("aftersale_info")] + [System.Xml.Serialization.XmlElement("aftersale_info")] + public Types.AftersaleOrder AftersaleOrder { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/ComplaintNotifyEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/ComplaintNotifyEvent.cs new file mode 100644 index 00000000..29f0f548 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/ComplaintNotifyEvent.cs @@ -0,0 +1,47 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Events +{ + /// + /// 表示 EVENT.aftersale_user_cancel 事件的数据。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/callback/complaint_order.html + /// + public class ComplaintNotifyEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable + { + public static class Types + { + public class ComplaintOrder + { + /// + /// 获取或设置纠纷单 ID。 + /// + [Newtonsoft.Json.JsonProperty("complaint_order_id")] + [System.Text.Json.Serialization.JsonPropertyName("complaint_order_id")] + [System.Xml.Serialization.XmlElement("complaint_order_id")] + public long ComplaintOrderId { get; set; } + + /// + /// 获取或设置纠纷状态。 + /// + [Newtonsoft.Json.JsonProperty("state")] + [System.Text.Json.Serialization.JsonPropertyName("state")] + [System.Xml.Serialization.XmlElement("state")] + public int State { get; set; } + + /// + /// 获取或设置纠纷处理事件。 + /// + [Newtonsoft.Json.JsonProperty("event")] + [System.Text.Json.Serialization.JsonPropertyName("event")] + [System.Xml.Serialization.XmlElement("event")] + public int Event { get; set; } + } + } + + /// + /// 获取或设置纠纷单信息。 + /// + [Newtonsoft.Json.JsonProperty("complaint_info")] + [System.Text.Json.Serialization.JsonPropertyName("complaint_info")] + [System.Xml.Serialization.XmlElement("complaint_info")] + public Types.ComplaintOrder ComplaintOrder { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Complaint/ShopComplaintGetListResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Complaint/ShopComplaintGetListResponse.cs index f63e2361..a38e753a 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Complaint/ShopComplaintGetListResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Complaint/ShopComplaintGetListResponse.cs @@ -9,6 +9,13 @@ { public class ComplaintOrder { + /// + /// 获取或设置纠纷单 ID。 + /// + [Newtonsoft.Json.JsonProperty("complaint_order_id")] + [System.Text.Json.Serialization.JsonPropertyName("complaint_order_id")] + public long ComplaintOrderId { get; set; } + /// /// 获取或设置关联订单 ID。 /// @@ -23,13 +30,6 @@ [System.Text.Json.Serialization.JsonPropertyName("after_sale_order_id")] public long AftersaleOrderId { get; set; } - /// - /// 获取或设置纠纷单 ID。 - /// - [Newtonsoft.Json.JsonProperty("complaint_order_id")] - [System.Text.Json.Serialization.JsonPropertyName("complaint_order_id")] - public long ComplaintOrderId { get; set; } - /// /// 获取或设置用户 OpenId。 /// diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleNewOrderEvent.xml b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleNewOrderEvent.xml new file mode 100644 index 00000000..146fc75b --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleNewOrderEvent.xml @@ -0,0 +1,12 @@ + + gh_abcdefg + oABCD + 12344555555 + event + aftersale_new_order + + 123456 + 1234567 + abc1234567 + + \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleRefundSuccessEvent.xml b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleRefundSuccessEvent.xml new file mode 100644 index 00000000..14427609 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleRefundSuccessEvent.xml @@ -0,0 +1,11 @@ + + gh_abcdefg + oABCD + 12344555555 + event + aftersale_refund_success + + 123456 + 1234567 + + \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleUserCancelEvent.xml b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleUserCancelEvent.xml new file mode 100644 index 00000000..505ba655 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleUserCancelEvent.xml @@ -0,0 +1,11 @@ + + gh_abcdefg + oABCD + 12344555555 + event + aftersale_user_cancel + + 123456 + 1234567 + + \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleWaitMerchantConfirmReceiptEvent.xml b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleWaitMerchantConfirmReceiptEvent.xml new file mode 100644 index 00000000..fd769072 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleWaitMerchantConfirmReceiptEvent.xml @@ -0,0 +1,11 @@ + + gh_abcdefg + oABCD + 12344555555 + event + aftersale_wait_merchant_confirm_receipt + + 123456 + 1234567 + + \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleWaitMerchantOfflineRefundEvent.xml b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleWaitMerchantOfflineRefundEvent.xml new file mode 100644 index 00000000..f863b4e2 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/AftersaleWaitMerchantOfflineRefundEvent.xml @@ -0,0 +1,11 @@ + + gh_abcdefg + oABCD + 12344555555 + event + aftersale_wait_merchant_offline_refund + + 123456 + 1234567 + + \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/ComplaintNotifyEvent.xml b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/ComplaintNotifyEvent.xml new file mode 100644 index 00000000..239b5c3b --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/ComplaintNotifyEvent.xml @@ -0,0 +1,12 @@ + + gh_abcdefg + oABCD + 12344555555 + event + complaint_notify + + 12345678 + 1 + 2 + + \ No newline at end of file