From fd524a766424739a152543076f737c68de33a8ca Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Thu, 23 Jun 2022 12:05:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(work):=20=E6=96=B0=E5=A2=9E=E4=B8=8A?= =?UTF-8?q?=E4=B8=8B=E6=B8=B8=E7=9B=B8=E5=85=B3=E5=9B=9E=E8=B0=83=E9=80=9A?= =?UTF-8?q?=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 --- .../Events/Batch/BatchJobResultEvent.cs | 1 + .../Events/Chain/ChangeChainEvent.cs | 54 +++++++++++++++++++ .../EventSamples/Chain/ChangeChainEvent.xml | 17 ++++++ 3 files changed, 72 insertions(+) create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Work/Events/Chain/ChangeChainEvent.cs create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Work.UnitTests/EventSamples/Chain/ChangeChainEvent.xml diff --git a/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Batch/BatchJobResultEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Batch/BatchJobResultEvent.cs index c8306456..fa6454f4 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Batch/BatchJobResultEvent.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Batch/BatchJobResultEvent.cs @@ -9,6 +9,7 @@ /// REF: https://developer.work.weixin.qq.com/document/path/90376 /// REF: https://developer.work.weixin.qq.com/document/path/91167 /// REF: https://developer.work.weixin.qq.com/document/path/90858 + /// REF: https://developer.work.weixin.qq.com/document/path/95797 /// public class BatchJobResultEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable { diff --git a/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Chain/ChangeChainEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Chain/ChangeChainEvent.cs new file mode 100644 index 00000000..060b74e9 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Chain/ChangeChainEvent.cs @@ -0,0 +1,54 @@ +namespace SKIT.FlurlHttpClient.Wechat.Work.Events +{ + /// + /// 表示 EVENT.change_chain 事件的数据。 + /// REF: https://developer.work.weixin.qq.com/document/path/95796 + /// + public class ChangeChainEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable + { + public static class Types + { + public class GroupIdList + { + /// + /// 获取或设置分组 ID 列表。 + /// + [System.Xml.Serialization.XmlElement("GroupId", Type = typeof(int))] + public int[] Items { get; set; } = default!; + } + + public class CorpIdList + { + /// + /// 获取或设置企业 ID 列表。 + /// + [System.Xml.Serialization.XmlElement("CorpId", Type = typeof(string))] + public string[] Items { get; set; } = default!; + } + } + + /// + /// 获取或设置操作类型。 + /// + [System.Xml.Serialization.XmlElement("ChangeType")] + public string ActionType { get; set; } = default!; + + /// + /// 获取或设置上下游 ID。 + /// + [System.Xml.Serialization.XmlElement("ChainId")] + public string ChainId { get; set; } = default!; + + /// + /// 获取或设置分组 ID 列表。 + /// + [System.Xml.Serialization.XmlElement("GroupIds", IsNullable = true)] + public Types.GroupIdList? GroupIdList { get; set; } + + /// + /// 获取或设置企业 ID 列表。 + /// + [System.Xml.Serialization.XmlElement("CorpIds", IsNullable = true)] + public Types.CorpIdList? CorpIdList { get; set; } + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Work.UnitTests/EventSamples/Chain/ChangeChainEvent.xml b/test/SKIT.FlurlHttpClient.Wechat.Work.UnitTests/EventSamples/Chain/ChangeChainEvent.xml new file mode 100644 index 00000000..bb7164d7 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Work.UnitTests/EventSamples/Chain/ChangeChainEvent.xml @@ -0,0 +1,17 @@ + + + + 1403610513 + + + + ![CDATA[xxxxxx]] + + 5 + 6 + + + ![CDATA[xxxxxx]] + ![CDATA[xxxxxx]] + +