From a4db7328c0f906b941eae103440a7f5f720a22b2 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Sat, 18 Sep 2021 14:58:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(wxapi):=20=E6=96=B0=E5=A2=9E=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E5=AE=A1=E6=A0=B8=E7=9B=B8=E5=85=B3=E7=9A=84=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E9=80=9A=E7=9F=A5=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 --- .../OpenProductAccountRegisterEvent.cs | 1 + .../OpenProduct/OpenProductBrandAuditEvent.cs | 1 + .../OpenProductCategoryAuditEvent.cs | 1 + .../OpenProduct/OpenProductSPUAuditEvent.cs | 1 + .../OpenProductSceneGroupAuditEvent.cs | 88 +++++++++++++++++++ .../Shop/Register/ShopRegisterApplyRequest.cs | 6 ++ .../OpenProductSceneGroupAuditEvent.xml | 22 +++++ .../Register/ShopRegisterApplyRequest.json | 4 +- 8 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductSceneGroupAuditEvent.cs create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/OpenProductSceneGroupAuditEvent.xml diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductAccountRegisterEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductAccountRegisterEvent.cs index 77e20173..c4cf9abc 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductAccountRegisterEvent.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductAccountRegisterEvent.cs @@ -6,6 +6,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events /// /// 表示 EVENT.open_product_account_register 事件的数据。 /// REF: https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent2/callback/account_register.html + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/callback/account_register.html /// public class OpenProductAccountRegisterEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable { diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductBrandAuditEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductBrandAuditEvent.cs index 2564da59..702adb6d 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductBrandAuditEvent.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductBrandAuditEvent.cs @@ -6,6 +6,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events /// /// 表示 EVENT.open_product_brand_audit 事件的数据。 /// REF: https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent2/callback/brand_audit.html + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/callback/brand_audit.html /// public class OpenProductBrandAuditEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable { diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductCategoryAuditEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductCategoryAuditEvent.cs index 0f4d9a71..a62be595 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductCategoryAuditEvent.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductCategoryAuditEvent.cs @@ -6,6 +6,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events /// /// 表示 EVENT.open_product_category_audit 事件的数据。 /// REF: https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent2/callback/category_audit.html + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/callback/category_audit.html /// public class OpenProductCategoryAuditEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable { diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductSPUAuditEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductSPUAuditEvent.cs index 301b7599..94cbcc0a 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductSPUAuditEvent.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductSPUAuditEvent.cs @@ -6,6 +6,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events /// /// 表示 EVENT.open_product_spu_audit 事件的数据。 /// REF: https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent2/callback/spu_audit.html + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/callback/spu_audit.html /// public class OpenProductSPUAuditEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable { diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductSceneGroupAuditEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductSceneGroupAuditEvent.cs new file mode 100644 index 00000000..a3412e4e --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/OpenProductSceneGroupAuditEvent.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Events +{ + /// + /// 表示 EVENT.open_product_scene_group_audit 事件的数据。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/callback/scene_group_audit.html + /// + public class OpenProductSceneGroupAuditEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable + { + public static class Types + { + public class EventData + { + public static class Types + { + public class SceneGroupExtra + { + /// + /// 获取或设置审核项目 ID。 + /// + [Newtonsoft.Json.JsonProperty("ext_id")] + [System.Text.Json.Serialization.JsonPropertyName("ext_id")] + [System.Xml.Serialization.XmlElement("ext_id")] + public int ExtraId { get; set; } + + /// + /// 获取或设置审核项目名称。 + /// + [Newtonsoft.Json.JsonProperty("name")] + [System.Text.Json.Serialization.JsonPropertyName("name")] + [System.Xml.Serialization.XmlElement("name")] + public string Name { get; set; } = default!; + + /// + /// 获取或设置审核结果。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + [System.Xml.Serialization.XmlElement("status")] + public int Status { get; set; } + } + } + + /// + /// 获取或设置场景 ID。 + /// + [Newtonsoft.Json.JsonProperty("group_id")] + [System.Text.Json.Serialization.JsonPropertyName("group_id")] + [System.Xml.Serialization.XmlElement("status")] + public int GroupId { get; set; } + + /// + /// 获取或设置场景名称。 + /// + [Newtonsoft.Json.JsonProperty("name")] + [System.Text.Json.Serialization.JsonPropertyName("name")] + [System.Xml.Serialization.XmlElement("name")] + public string Name { get; set; } = default!; + + /// + /// 获取或设置审核文案。 + /// + [Newtonsoft.Json.JsonProperty("reason")] + [System.Text.Json.Serialization.JsonPropertyName("reason")] + [System.Xml.Serialization.XmlElement("reason")] + public string Reason { get; set; } = default!; + + /// + /// 获取或设置场景审核结果列表。 + /// + [Newtonsoft.Json.JsonProperty("scene_group_ext_list")] + [System.Text.Json.Serialization.JsonPropertyName("scene_group_ext_list")] + [System.Xml.Serialization.XmlElement("scene_group_ext_list", Type = typeof(Types.SceneGroupExtra))] + public Types.SceneGroupExtra[] SceneGroupExtraList { get; set; } = default!; + } + } + + /// + /// 获取或设置事件数据。 + /// + [Newtonsoft.Json.JsonProperty("SceneGroupAudit")] + [System.Text.Json.Serialization.JsonPropertyName("SceneGroupAudit")] + [System.Xml.Serialization.XmlElement("SceneGroupAudit")] + public Types.EventData EventData { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Register/ShopRegisterApplyRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Register/ShopRegisterApplyRequest.cs index 62dba145..fb2a4a26 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Register/ShopRegisterApplyRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Register/ShopRegisterApplyRequest.cs @@ -8,5 +8,11 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// public class ShopRegisterApplyRequest : WechatApiRequest { + /// + /// 获取或设置场景 ID。 + /// + [Newtonsoft.Json.JsonProperty("scene_group_id")] + [System.Text.Json.Serialization.JsonPropertyName("scene_group_id")] + public int SceneGroupId { get; set; } } } diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/OpenProductSceneGroupAuditEvent.xml b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/OpenProductSceneGroupAuditEvent.xml new file mode 100644 index 00000000..cfd86ddb --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/OpenProductSceneGroupAuditEvent.xml @@ -0,0 +1,22 @@ + + + + 1623856215 + + + + 1 + + + + 1 + 1 + + + + 2 + 1 + + + + \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Register/ShopRegisterApplyRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Register/ShopRegisterApplyRequest.json index 22fdca1b..c9d4676e 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Register/ShopRegisterApplyRequest.json +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Register/ShopRegisterApplyRequest.json @@ -1 +1,3 @@ -{} \ No newline at end of file +{ + "scene_group_id": 1 +} \ No newline at end of file