diff --git a/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/ImageMessageReply.cs b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/ImageMessageReply.cs new file mode 100644 index 00000000..a8d1773d --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/ImageMessageReply.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Work.Events +{ + /// + /// 表示被动回复图片消息的数据。 + /// REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90241#%E5%9B%BE%E7%89%87%E6%B6%88%E6%81%AF + /// REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90377#%E5%9B%BE%E7%89%87%E6%B6%88%E6%81%AF + /// REF: https://open.work.weixin.qq.com/api/doc/90002/90151/90859#%E5%9B%BE%E7%89%87%E6%B6%88%E6%81%AF + /// + public class ImageMessageReply : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable + { + public new static class Types + { + public class Image + { + /// + /// 获取或设置图片 MediaId。 + /// + [System.Xml.Serialization.XmlElement("MediaId")] + public string MediaId { get; set; } = string.Empty; + } + } + + /// + /// 获取或设置图片信息。 + /// + [System.Xml.Serialization.XmlElement("Image")] + public Types.Image Image { get; set; } = new Types.Image(); + + public ImageMessageReply() + { + Event = null; + MessageType = "image"; + } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/NewsMessageReply.cs b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/NewsMessageReply.cs new file mode 100644 index 00000000..1745e8f3 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/NewsMessageReply.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Work.Events +{ + /// + /// 表示被动回复图文消息的数据。 + /// REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90241#%E5%9B%BE%E6%96%87%E6%B6%88%E6%81%AF + /// REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90377#%E5%9B%BE%E6%96%87%E6%B6%88%E6%81%AF + /// REF: https://open.work.weixin.qq.com/api/doc/90002/90151/90859#%E5%9B%BE%E6%96%87%E6%B6%88%E6%81%AF + /// + public class NewsMessageReply : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable + { + public new static class Types + { + public class ArticleItem + { + /// + /// 获取或设置图文链接。 + /// + [System.Xml.Serialization.XmlElement("Url")] + public string Url { get; set; } = string.Empty; + + /// + /// 获取或设置图文封面图片链接。 + /// + [System.Xml.Serialization.XmlElement("PicUrl")] + public string PictureUrl { get; set; } = string.Empty; + + /// + /// 获取或设置图文标题。 + /// + [System.Xml.Serialization.XmlElement("Title")] + public string Title { get; set; } = string.Empty; + + /// + /// 获取或设置图文描述。 + /// + [System.Xml.Serialization.XmlElement("Description")] + public string Description { get; set; } = string.Empty; + } + + public class ArticleList + { + /// + /// 获取或设置图文列表。 + /// + [System.Xml.Serialization.XmlElement("item", Type = typeof(ArticleItem))] + public ArticleItem[] Items { get; set; } = new ArticleItem[0]; + } + } + + /// + /// 获取或设置图文数量。 + /// + [System.Xml.Serialization.XmlElement("ArticleCount")] + public int ArticleCount { get; set; } + + /// + /// 获取或设置图文列表。 + /// + [System.Xml.Serialization.XmlElement("Articles")] + public Types.ArticleList ArticleList { get; set; } = new Types.ArticleList(); + + public NewsMessageReply() + { + Event = null; + MessageType = "news"; + } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/TextMessageReply.cs b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/TextMessageReply.cs new file mode 100644 index 00000000..4bb41ed7 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/TextMessageReply.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Work.Events +{ + /// + /// 表示被动回复文本消息的数据。 + /// REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90241#%E6%96%87%E6%9C%AC%E6%B6%88%E6%81%AF + /// REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90377#%E6%96%87%E6%9C%AC%E6%B6%88%E6%81%AF + /// REF: https://open.work.weixin.qq.com/api/doc/90002/90151/90859#%E6%96%87%E6%9C%AC%E6%B6%88%E6%81%AF + /// + public class TextMessageReply : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable + { + /// + /// 获取或设置消息内容。 + /// + [System.Xml.Serialization.XmlElement("Content")] + public string Content { get; set; } = string.Empty; + + public TextMessageReply() + { + Event = null; + MessageType = "text"; + } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/UpdateTaskCardReply.cs b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/UpdateTaskCardReply.cs new file mode 100644 index 00000000..fbc04079 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/UpdateTaskCardReply.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Work.Events +{ + /// + /// 表示被动回复任务卡片更新消息的数据。 + /// REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90241#%E4%BB%BB%E5%8A%A1%E5%8D%A1%E7%89%87%E6%9B%B4%E6%96%B0%E6%B6%88%E6%81%AF + /// REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90377#%E4%BB%BB%E5%8A%A1%E5%8D%A1%E7%89%87%E6%9B%B4%E6%96%B0%E6%B6%88%E6%81%AF + /// REF: https://open.work.weixin.qq.com/api/doc/90002/90151/90859#%E4%BB%BB%E5%8A%A1%E5%8D%A1%E7%89%87%E6%9B%B4%E6%96%B0%E6%B6%88%E6%81%AF + /// + public class UpdateTaskCardReply : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable + { + public new static class Types + { + public class TaskCard + { + /// + /// 获取或设置点击任务卡片按钮后显示的按钮名称。 + /// + [System.Xml.Serialization.XmlElement("ReplaceName")] + public string ReplacementText { get; set; } = string.Empty; + } + } + + /// + /// 获取或设置任务卡片信息。 + /// + [System.Xml.Serialization.XmlElement("TaskCard")] + public Types.TaskCard? TaskCard { get; set; } + + public UpdateTaskCardReply() + { + Event = null; + MessageType = "update_taskcard"; + } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/VideoMessageReply.cs b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/VideoMessageReply.cs new file mode 100644 index 00000000..09327551 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/VideoMessageReply.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Work.Events +{ + /// + /// 表示被动回复视频消息的数据。 + /// REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90241#%E8%A7%86%E9%A2%91%E6%B6%88%E6%81%AF + /// REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90377#%E8%A7%86%E9%A2%91%E6%B6%88%E6%81%AF + /// REF: https://open.work.weixin.qq.com/api/doc/90002/90151/90859#%E8%A7%86%E9%A2%91%E6%B6%88%E6%81%AF + /// + public class VideoMessageReply : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable + { + public new static class Types + { + public class Video + { + /// + /// 获取或设置视频 MediaId。 + /// + [System.Xml.Serialization.XmlElement("MediaId")] + public string MediaId { get; set; } = string.Empty; + + /// + /// 获取或设置视频标题。 + /// + [System.Xml.Serialization.XmlElement("Title")] + public string Title { get; set; } = string.Empty; + + /// + /// 获取或设置视频描述。 + /// + [System.Xml.Serialization.XmlElement("Description")] + public string Description { get; set; } = string.Empty; + } + } + + /// + /// 获取或设置视频信息。 + /// + [System.Xml.Serialization.XmlElement("Video")] + public Types.Video Video { get; set; } = new Types.Video(); + + public VideoMessageReply() + { + Event = null; + MessageType = "video"; + } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/VoiceMessageReply.cs b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/VoiceMessageReply.cs new file mode 100644 index 00000000..1f98df41 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Work/Events/Reply/VoiceMessageReply.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Work.Events +{ + /// + /// 表示被动回复语音消息的数据。 + /// REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90241#%E8%AF%AD%E9%9F%B3%E6%B6%88%E6%81%AF + /// REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90377#%E8%AF%AD%E9%9F%B3%E6%B6%88%E6%81%AF + /// REF: https://open.work.weixin.qq.com/api/doc/90002/90151/90859#%E8%AF%AD%E9%9F%B3%E6%B6%88%E6%81%AF + /// + public class VoiceMessageReply : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable + { + public new static class Types + { + public class Voice + { + /// + /// 获取或设置语音 MediaId。 + /// + [System.Xml.Serialization.XmlElement("MediaId")] + public string MediaId { get; set; } = string.Empty; + } + } + + /// + /// 获取或设置语音信息。 + /// + [System.Xml.Serialization.XmlElement("Voice")] + public Types.Voice Voice { get; set; } = new Types.Voice(); + + public VoiceMessageReply() + { + Event = null; + MessageType = "voice"; + } + } +}