mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-12-29 18:04:42 +08:00
feat(wxapi): 新增部分微信回调通知事件
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示被动回复图片消息的数据。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Passive_user_reply_message.html#1 </para>
|
||||
/// </summary>
|
||||
public class ImageMessageReply : WechatApiEvent, WechatApiEvent.Types.IXmlSerializable
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class Image
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图片 MediaId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("MediaId")]
|
||||
public string MediaId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Image")]
|
||||
public Types.Image Image { get; set; } = new Types.Image();
|
||||
|
||||
public ImageMessageReply()
|
||||
{
|
||||
Event = null;
|
||||
MessageType = "image";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示被动回复音乐消息的数据。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Passive_user_reply_message.html#4 </para>
|
||||
/// </summary>
|
||||
public class MusicMessageReply : WechatApiEvent, WechatApiEvent.Types.IXmlSerializable
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class Music
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置音乐链接。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("MusicUrl")]
|
||||
public string MusicUrl { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置高质量音乐链接。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("HQMusicUrl", IsNullable = true)]
|
||||
public string? HQMusicUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置音乐封面图片 MediaId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ThumbMediaId")]
|
||||
public string ThumbMediaId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置音乐标题。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Title")]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置音乐描述。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置音乐信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Music")]
|
||||
public Types.Music Music { get; set; } = new Types.Music();
|
||||
|
||||
public MusicMessageReply()
|
||||
{
|
||||
Event = null;
|
||||
MessageType = "music";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示被动回复图文消息的数据。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Passive_user_reply_message.html#5 </para>
|
||||
/// </summary>
|
||||
public class NewsMessageReply : WechatApiEvent, WechatApiEvent.Types.IXmlSerializable
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class Article
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图文链接。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Url")]
|
||||
public string Url { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文封面图片链接。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("PicUrl")]
|
||||
public string PictureUrl { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文标题。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Title")]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文描述。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文数量。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ArticleCount")]
|
||||
public int ArticleCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图文列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlArray("Articles")]
|
||||
[System.Xml.Serialization.XmlArrayItem("item")]
|
||||
public Types.Article[] ArticleList { get; set; } = new Types.Article[0];
|
||||
|
||||
public NewsMessageReply()
|
||||
{
|
||||
Event = null;
|
||||
MessageType = "news";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示被动回复文本消息的数据。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Passive_user_reply_message.html#0 </para>
|
||||
/// </summary>
|
||||
public class TextMessageReply : WechatApiEvent, WechatApiEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置消息内容。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Content")]
|
||||
public string Content { get; set; } = string.Empty;
|
||||
|
||||
public TextMessageReply()
|
||||
{
|
||||
Event = null;
|
||||
MessageType = "text";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示被动回复转发消息的数据。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Customer_Service/Forwarding_of_messages_to_service_center.html </para>
|
||||
/// </summary>
|
||||
public class TransferCustomerServiceReply : WechatApiEvent, WechatApiEvent.Types.IXmlSerializable
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class Transfer
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置客服账号。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("KfAccount")]
|
||||
public string KfAccount { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置转发信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("TransInfo")]
|
||||
public Types.Transfer? Transfer { get; set; }
|
||||
|
||||
public TransferCustomerServiceReply()
|
||||
{
|
||||
Event = null;
|
||||
MessageType = "transfer_customer_service";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示被动回复视频消息的数据。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Passive_user_reply_message.html#3 </para>
|
||||
/// </summary>
|
||||
public class VideoMessageReply : WechatApiEvent, WechatApiEvent.Types.IXmlSerializable
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class Video
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置视频 MediaId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("MediaId")]
|
||||
public string MediaId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置视频标题。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Title")]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置视频描述。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置视频信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Video")]
|
||||
public Types.Video Video { get; set; } = new Types.Video();
|
||||
|
||||
public VideoMessageReply()
|
||||
{
|
||||
Event = null;
|
||||
MessageType = "video";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示被动回复语音消息的数据。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Passive_user_reply_message.html#2 </para>
|
||||
/// </summary>
|
||||
public class VoiceMessageReply : WechatApiEvent, WechatApiEvent.Types.IXmlSerializable
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class Voice
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置语音 MediaId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("MediaId")]
|
||||
public string MediaId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置语音信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Voice")]
|
||||
public Types.Voice Voice { get; set; } = new Types.Voice();
|
||||
|
||||
public VoiceMessageReply()
|
||||
{
|
||||
Event = null;
|
||||
MessageType = "voice";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user