mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 01:58:14 +08:00
feat(work): 封装部分企业微信回调通知事件模型
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.switch_workbench_mode 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92535 </para>
|
||||
/// </summary>
|
||||
public class SwitchWorkbenchModeEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置自定义模式。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Mode")]
|
||||
public int Mode { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,241 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.open_approval_change 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90269 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/93798 </para>
|
||||
/// </summary>
|
||||
public class OpenApprovalChangeEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class Approval
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class ApprovalRecord
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class RecordDetail
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class ApprovalerList
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置审批人列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlArray("Item")]
|
||||
public ApprovalerItem[] Items { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class ApprovalerItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置审批人成员账号。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ItemUserId")]
|
||||
public string UserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批人名称。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ItemName")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批人部门名称。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ItemParty")]
|
||||
public string DepartmentName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批人头像 URL。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ItemImage")]
|
||||
public string AvatarUrl { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分支审批状态。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ItemStatus")]
|
||||
public int ApproveStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分支审批时间戳。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ItemOpTime", IsNullable = true)]
|
||||
public long? ApproveTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批意见。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ItemSpeech", IsNullable = true)]
|
||||
public string? Speech { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置节点审批状态。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("NodeStatus")]
|
||||
public int ApproveStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置节点审批方式。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("NodeAttr")]
|
||||
public int ApproveType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置节点类型。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("NodeType")]
|
||||
public int NodeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置节点审批人列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlArray("Items")]
|
||||
public Types.ApprovalerList ApprovalerList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批流程详情列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlArray("ApprovalNode")]
|
||||
public Types.RecordDetail[] RecordDetailList { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class Notification
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Notifier
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置抄送人成员账号。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ItemUserid")]
|
||||
public string UserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置抄送人名称。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ItemName")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置抄送人部门名称。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ItemParty")]
|
||||
public string DepartmentName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置抄送人头像 URL。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ItemImage")]
|
||||
public string AvatarUrl { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批抄送列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlArray("NotifyNode")]
|
||||
public Types.Notifier[] NotifierList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置第三方审批单号。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ThirdNo")]
|
||||
public string ThirdPartyApprovalNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置服务商审批模板 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("OpenTemplateId")]
|
||||
public string OpenTemplateId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批单名称。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("OpenSpName")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批单状态。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("OpenSpStatus")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置申请时间戳。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ApplyTime")]
|
||||
public long ApplyTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置申请人成员账号。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ApplyUserId")]
|
||||
public string ApplicantUserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置申请人成员名称。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ApplyUserName")]
|
||||
public string ApplicantName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置提单部门名称。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ApplyUserParty")]
|
||||
public string ApplicantDepartmentName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置申请人头像 URL。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ApplyUserImage")]
|
||||
public string ApplicantAvatarUrl { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ApprovalNodes")]
|
||||
public Types.ApprovalRecord ApprovalRecord { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置抄送信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("NotifyNodes")]
|
||||
public Types.Notification Notification { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置当前审批节点。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ApproverStep")]
|
||||
public int ApproverStep { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置第三方审批单信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ApprovalInfo")]
|
||||
public Types.Approval Approval { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,233 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.sys_approval_change 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/91815 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/92633 </para>
|
||||
/// </summary>
|
||||
public class SystemApprovalChangeEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class Approval
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Applicant
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置申请人成员账号。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("UserId")]
|
||||
public string UserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置提单部门 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Party")]
|
||||
public int DepartmentId { get; set; }
|
||||
}
|
||||
|
||||
public class Notifier
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置抄送人成员账号。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("UserId")]
|
||||
public string UserId { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class Record
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class RecordDetail
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Approver
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置审批人成员账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批人信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Approver")]
|
||||
public Types.Approver Approver { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分支审批状态。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SpStatus")]
|
||||
public int ApproveStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分支审批时间戳。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SpTime", IsNullable = true)]
|
||||
public long? ApproveTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批意见。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Speech", IsNullable = true)]
|
||||
public string? Speech { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批意见附件 MediaId 列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlArray("Attach", IsNullable = true)]
|
||||
public string[]? SpeechMediaIdList { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置节点审批状态。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SpStatus")]
|
||||
public int ApproveStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批方式。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ApproverAttr")]
|
||||
public int ApproveType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批流程详情列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlArray("Details")]
|
||||
public Types.RecordDetail[] DetailList { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class Comment
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class CommentUser
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置评论人成员账号。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("UserId")]
|
||||
public string UserId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置评论 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("CommentId")]
|
||||
public string CommentId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置评论人信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("CommentUserInfo")]
|
||||
public Types.CommentUser CommentUser { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置评论内容。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("CommentContent")]
|
||||
public string Content { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置评论内容附件 MediaId 列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlArray("Attach")]
|
||||
public string[] MediaIdList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置评论时间戳。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("CommentTime")]
|
||||
public long CreateTimestamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批申请状态变化类型。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("StatuChangeEvent")]
|
||||
public int StatusChangeEvent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批单号。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SpNo")]
|
||||
public string ApprovalNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批单名称。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SpName")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批单状态。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SpStatus")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批模板 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("TemplateId")]
|
||||
public string TemplateId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置申请人信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Applyer")]
|
||||
public Types.Applicant Applicant { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置申请时间戳。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ApplyTime")]
|
||||
public long ApplyTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置抄送人列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlArray("Notifyer")]
|
||||
public Types.Notifier[]? NotifyerList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批流程列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlArray("SpRecord")]
|
||||
public Types.Record[] RecordList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置评论列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlArray("Comments")]
|
||||
public Types.Comment[] CommentList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审批单信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ApprovalInfo")]
|
||||
public Types.Approval Approval { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.batch_job_result 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90973 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90240 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/91135 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90376 </para>
|
||||
/// </summary>
|
||||
public class BatchJobResultEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class BatchJob
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("JobId")]
|
||||
public string JobId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务类型。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("JobType")]
|
||||
public string Type { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误码。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ErrCode")]
|
||||
public int ErrorCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ErrMsg", IsNullable = true)]
|
||||
public string? ErrorMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置异步任务信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("BatchJob")]
|
||||
public Types.BatchJob BatchJob { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.add_calendar 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93651 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/93704 </para>
|
||||
/// </summary>
|
||||
public class AddCalendarEvent : WechatWorkEvent, WechatWorkEvent.Types.IJsonSerializable, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置日历 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("CalId")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("CalId")]
|
||||
[System.Xml.Serialization.XmlElement("CalId")]
|
||||
public string CalendarId { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.delete_calendar 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93651 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/93704 </para>
|
||||
/// </summary>
|
||||
public class DeleteCalendarEvent : AddCalendarEvent, WechatWorkEvent.Types.IJsonSerializable, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.modify_calendar 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93651 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/93704 </para>
|
||||
/// </summary>
|
||||
public class ModifyCalendarEvent : AddCalendarEvent, WechatWorkEvent.Types.IJsonSerializable, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,244 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.change_contact 或 INFO.change_contact 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90970 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90971 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90972 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90135/90240 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/92654 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/92655 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/92656 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90639 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90640 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90641 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90376 </para>
|
||||
/// </summary>
|
||||
public class ChangeContactEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class ExtendedAttribute
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置属性类型。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置属性名称。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Name")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文本属性值。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Text", IsNullable = true)]
|
||||
public TextAttribute? Text { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置网页属性值。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Web", IsNullable = true)]
|
||||
public WebAttribute? Web { get; set; }
|
||||
}
|
||||
|
||||
public class TextAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置文本内容。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Value")]
|
||||
public string Value { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class WebAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置网页标题。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Title")]
|
||||
public string Title { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置网页 URL。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Url")]
|
||||
public string Url { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置自定义字段列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlArray("Item")]
|
||||
public Types.Attribute[] AttributeList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置第三方应用的 SuiteId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SuiteId", IsNullable = true)]
|
||||
public string? SuiteId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权方的 CorpId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
|
||||
public string? AuthorizerCorpId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置操作类型。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ChangeType")]
|
||||
public string ActionType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员、部门或标签名称。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Name")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户成员账号。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("UserID", IsNullable = true)]
|
||||
public string? UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户成员别名。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Alias", IsNullable = true)]
|
||||
public string? UserAlias { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户所在部门 ID(以逗号分割)。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Department", IsNullable = true)]
|
||||
public string? UserDepartmentIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户的部门领导状态(以逗号分割)。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("IsLeaderInDept", IsNullable = true)]
|
||||
public string? UserDepartmentLeaderStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户的主部门 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("MainDepartment", IsNullable = true)]
|
||||
public int? UserMainDepartmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户邮箱。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Email", IsNullable = true)]
|
||||
public string? UserEmail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户手机号码。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Mobile", IsNullable = true)]
|
||||
public string? UserMobileNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户座机号码。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Telephone", IsNullable = true)]
|
||||
public string? UserTeleNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户性别。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Gender", IsNullable = true)]
|
||||
public int? UserGender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户地址。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Address", IsNullable = true)]
|
||||
public string? UserAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户职务。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Position", IsNullable = true)]
|
||||
public string? UserPosition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户头像 URL。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Avatar", IsNullable = true)]
|
||||
public string? UserAvatarUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户激活状态。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Status", IsNullable = true)]
|
||||
public int? UserStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户自定义字段信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ExtAttr", IsNullable = true)]
|
||||
public Types.ExtendedAttribute? UserExtendedAttribute { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置部门 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Id", IsNullable = true)]
|
||||
public int? DepartmentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置上级部门 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ParentId", IsNullable = true)]
|
||||
public string? DepartmentParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置部门排序值。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Order", IsNullable = true)]
|
||||
public int? DepartmentOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置标签 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("TagId", IsNullable = true)]
|
||||
public int? TagId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置标签中新增的成员账号(以逗号分隔)。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AddUserItems", IsNullable = true)]
|
||||
public string? TagAddedUserIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置标签中删除的成员账号(以逗号分隔)。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("DelUserItems", IsNullable = true)]
|
||||
public string? TagRemovedUserIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置标签中新增的部门 ID(以逗号分隔)。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AddPartyItems", IsNullable = true)]
|
||||
public string? TagAddedDepartmentIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置标签中删除的部门 ID(以逗号分隔)。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("DelPartyItems", IsNullable = true)]
|
||||
public string? TagRemovedDepartmentIds { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.change_external_chat 或 INFO.change_external_chat 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92130 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/92277 </para>
|
||||
/// </summary>
|
||||
public class ChangeExternalChatEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方应用的 SuiteId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SuiteId", IsNullable = true)]
|
||||
public string? SuiteId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权方的 CorpId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
|
||||
public string? AuthorizerCorpId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置操作类型。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ChangeType")]
|
||||
public string ActionType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置客户群 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ChatId", IsNullable = true)]
|
||||
public string? GroupChatId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置客户群变更详情。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("UpdateDetail", IsNullable = true)]
|
||||
public string? UpdateDetail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置客户群入群场景值。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("JoinScene", IsNullable = true)]
|
||||
public int? JoinScene { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置客户群退群场景值。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("QuitScene", IsNullable = true)]
|
||||
public int? QuitScene { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.change_external_contact 或 INFO.change_external_contact 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92130 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92005 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/92277 </para>
|
||||
/// </summary>
|
||||
public class ChangeExternalContactEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方应用的 SuiteId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SuiteId", IsNullable = true)]
|
||||
public string? SuiteId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权方的 CorpId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
|
||||
public string? AuthorizerCorpId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置操作类型。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ChangeType")]
|
||||
public string ActionType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户成员账号。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("UserID", IsNullable = true)]
|
||||
public string? UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置外部联系人账号。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ExternalUserID", IsNullable = true)]
|
||||
public string? ExternalUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置自定义渠道参数。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("State", IsNullable = true)]
|
||||
public string? State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置欢迎语 Code。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("WelcomeCode", IsNullable = true)]
|
||||
public string? WelcomeCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置接替失败原因。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("FailReason", IsNullable = true)]
|
||||
public string? TransferFailReason { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.change_external_tag 或 INFO.change_external_tag 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92130 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/92277 </para>
|
||||
/// </summary>
|
||||
public class ChangeExternalTagEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方应用的 SuiteId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SuiteId", IsNullable = true)]
|
||||
public string? SuiteId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权方的 CorpId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
|
||||
public string? AuthorizerCorpId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置操作类型。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ChangeType")]
|
||||
public string ActionType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 ID 类型。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("TagType", IsNullable = true)]
|
||||
public string IdType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业标签或标签分组 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Id", IsNullable = true)]
|
||||
public string? TagOrGroupId { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.living_status_change 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/94145 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/94308 </para>
|
||||
/// </summary>
|
||||
public class LivingStatusChangeEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置直播 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("LivingId")]
|
||||
public string LivingId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置直播状态。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Status")]
|
||||
public int Status { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 IMAGE 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90239 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90375 </para>
|
||||
/// </summary>
|
||||
public class ImageMessageEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("MsgId")]
|
||||
public long MessageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片 URL。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("PicUrl")]
|
||||
public string PictureUrl { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片消息 MediaId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("MediaId")]
|
||||
public string MediaId { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 LINK 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90239 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90375 </para>
|
||||
/// </summary>
|
||||
public class LinkMessageEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("MsgId")]
|
||||
public long MessageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置标题。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Title")]
|
||||
public string Title { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置描述。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Description")]
|
||||
public string Description { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置跳转链接 URL。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Url")]
|
||||
public string Url { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置封面图片 URL。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("PicUrl")]
|
||||
public string PictureUrl { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 LOCATION 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90239 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90375 </para>
|
||||
/// </summary>
|
||||
public class LocationMessageEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用类型。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AppType", IsNullable = true)]
|
||||
public string? AppType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("MsgId")]
|
||||
public long MessageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置纬度坐标。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Location_X")]
|
||||
public double Latitude { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置经度坐标。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Location_Y")]
|
||||
public double Longitude { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置地图缩放大小。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Scale")]
|
||||
public double Scale { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置地理位置信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Label")]
|
||||
public string Label { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 TEXT 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90239 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90375 </para>
|
||||
/// </summary>
|
||||
public class TextMessageEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("MsgId")]
|
||||
public long MessageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息内容。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Content")]
|
||||
public string Content { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 VIDEO 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90239 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90375 </para>
|
||||
/// </summary>
|
||||
public class VideoMessageEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("MsgId")]
|
||||
public long MessageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置视频消息 MediaId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("MediaId")]
|
||||
public string MediaId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置视频消息缩略图 MediaId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ThumbMediaId")]
|
||||
public string ThumbnailMediaId { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 VOICE 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90239 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90375 </para>
|
||||
/// </summary>
|
||||
public class VoiceMessageEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("MsgId")]
|
||||
public long MessageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置语音格式。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Format")]
|
||||
public string Format { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置语音消息 MediaId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("MediaId")]
|
||||
public string MediaId { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.click 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90240 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90376 </para>
|
||||
/// </summary>
|
||||
public class ClickPushEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置事件 Key,即自定义菜单接口中的 Key 值。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("EventKey")]
|
||||
public string EventKey { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.enter_agent 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90240 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90376 </para>
|
||||
/// </summary>
|
||||
public class EnterAgentPushEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置事件 Key。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("EventKey")]
|
||||
public string? EventKey { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.LOCATION 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90240 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90376 </para>
|
||||
/// </summary>
|
||||
public class LocationPushEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用类型。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AppType", IsNullable = true)]
|
||||
public string? AppType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置地理位置纬度。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Latitude")]
|
||||
public double Latitude { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置地理位置经度。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Longitude")]
|
||||
public double Longitude { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置地理位置精度。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Precision")]
|
||||
public double Precision { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.scancode_push 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90240 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90376 </para>
|
||||
/// </summary>
|
||||
public class ScanCodePushEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class ScanCode
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置扫描类型。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ScanType")]
|
||||
public string ScanType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置扫描结果。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ScanResult")]
|
||||
public string ScanResult { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置事件 Key,即自定义菜单接口中的 Key 值。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("EventKey")]
|
||||
public string EventKey { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置扫描信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ScanCodeInfo")]
|
||||
public Types.ScanCode ScanCode { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.subscribe 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90240 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90376 </para>
|
||||
/// </summary>
|
||||
public class SubscribePushEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置事件 Key。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("EventKey", IsNullable = true)]
|
||||
public string? EventKey { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.taskcard_click 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90240 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90376 </para>
|
||||
/// </summary>
|
||||
public class TaskCardClickPushEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置事件 Key,即发送任务卡片时自定义按钮的 Key 值。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("EventKey")]
|
||||
public string EventKey { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("TaskId")]
|
||||
public string TaskId { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.unsubscribe 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90240 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90376 </para>
|
||||
/// </summary>
|
||||
public class UnsubscribePushEvent : SubscribePushEvent
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.view 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90240 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90376 </para>
|
||||
/// </summary>
|
||||
public class ViewPushEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentID")]
|
||||
public int AgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置事件 Key,即跳转的 URL。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("EventKey")]
|
||||
public string EventKey { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.add_schedule 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93651 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/93704 </para>
|
||||
/// </summary>
|
||||
public class AddScheduleEvent : WechatWorkEvent, WechatWorkEvent.Types.IJsonSerializable, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置日程 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("ScheduleId")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("ScheduleId")]
|
||||
[System.Xml.Serialization.XmlElement("ScheduleId")]
|
||||
public string ScheduleId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置日历 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("CalId")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("CalId")]
|
||||
[System.Xml.Serialization.XmlElement("CalId")]
|
||||
public string CalendarId { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.delete_schedule 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93651 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/93704 </para>
|
||||
/// </summary>
|
||||
public class DeleteScheduleEvent : AddScheduleEvent, WechatWorkEvent.Types.IJsonSerializable, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.modify_schedule 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93651 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/93704 </para>
|
||||
/// </summary>
|
||||
public class ModifyScheduleEvent : AddScheduleEvent, WechatWorkEvent.Types.IJsonSerializable, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.change_school_contact 或 INFO.change_school_contact 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92032 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92052 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/92051 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/92050 </para>
|
||||
/// </summary>
|
||||
public class ChangeSchoolContactEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方应用的 SuiteId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SuiteId", IsNullable = true)]
|
||||
public string? SuiteId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权方的 CorpId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
|
||||
public string? AuthorizerCorpId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置操作类型。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ChangeType")]
|
||||
public string ActionType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置学生/家长账号或部门 ID(即班级)。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("Id", IsNullable = true)]
|
||||
public string? StudentOrParentOrDepartmentId { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 INFO.cancel_auth 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90642 </para>
|
||||
/// </summary>
|
||||
public class CancelAuthEvent : ChangeAuthEvent
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 INFO.change_auth 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90642 </para>
|
||||
/// </summary>
|
||||
public class ChangeAuthEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方应用的 SuiteId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SuiteId")]
|
||||
public string SuiteId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权方的 CorpId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId")]
|
||||
public string AuthorizerCorpId { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 INFO.create_auth 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90642 </para>
|
||||
/// </summary>
|
||||
public class CreateAuthEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方应用的 SuiteId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SuiteId")]
|
||||
public string SuiteId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权码。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AuthCode")]
|
||||
public string AuthCode { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 INFO.register_corp 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90585 </para>
|
||||
/// </summary>
|
||||
public class RegisterCorpEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class ContactSync
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置通讯录迁移凭证。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AccessToken")]
|
||||
public string AccessToken { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置通讯录迁移凭证有效期(单位:秒)。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ExpiresIn")]
|
||||
public int ExpiresIn { get; set; }
|
||||
}
|
||||
|
||||
public class AuthorizerUser
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置成员账号。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("UserId")]
|
||||
public string UserId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置服务商 CorpId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ServiceCorpId")]
|
||||
public string ServiceCorpId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权方的 CorpId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId")]
|
||||
public string AuthorizerCorpId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置注册码。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("RegisterCode")]
|
||||
public string RegisterCode { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置通讯录迁移信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ContactSync", IsNullable = true)]
|
||||
public Types.ContactSync? ContactSync { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权管理员信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AuthUserInfo", IsNullable = true)]
|
||||
public Types.AuthorizerUser? AuthorizerUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置推广包 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("TemplateId")]
|
||||
public string TemplateId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置自定义渠道参数。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("State", IsNullable = true)]
|
||||
public string? State { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 EVENT.share_agent_change 或 INFO.share_agent_change 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/90240 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/93373 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90376 </para>
|
||||
/// </summary>
|
||||
public class ShareAgentChangeEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方应用的 SuiteId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SuiteId", IsNullable = true)]
|
||||
public string? SuiteId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置上级企业 CorpId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("CorpId", IsNullable = true)]
|
||||
public string? ParentCorpId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置上级企业应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AgentId")]
|
||||
public int ParentAgentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置下级企业应用 ID。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("AppId", IsNullable = true)]
|
||||
public int? AgentId { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 INFO.suite_ticket 事件的数据。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/90628 </para>
|
||||
/// </summary>
|
||||
public class SuiteTicketEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方应用的 SuiteId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SuiteId")]
|
||||
public string SuiteId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置第三方应用的 SuiteTicket。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("SuiteTicket")]
|
||||
public string SuiteTicket { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
/// <summary>
|
||||
/// 为 <see cref="WechatWorkClient"/> 提供回调通知事件的扩展方法。
|
||||
/// </summary>
|
||||
public static class WechatWorkClientEventExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>从 JSON 反序列化得到 <see cref="WechatWorkEvent"/> 对象。</para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="callbackJson"></param>
|
||||
/// <returns></returns>
|
||||
public static TEvent DeserializeEventFromJson<TEvent>(this WechatWorkClient client, string callbackJson)
|
||||
where TEvent : WechatWorkEvent, WechatWorkEvent.Types.IJsonSerializable, new()
|
||||
{
|
||||
if (client == null) throw new ArgumentNullException(nameof(client));
|
||||
if (string.IsNullOrEmpty(callbackJson)) throw new ArgumentNullException(callbackJson);
|
||||
|
||||
return client.JsonSerializer.Deserialize<TEvent>(callbackJson);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>从 XML 反序列化得到 <see cref="WechatWorkEvent"/> 对象。</para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="callbackXml"></param>
|
||||
/// <returns></returns>
|
||||
public static TEvent DeserializeEventFromXml<TEvent>(this WechatWorkClient client, string callbackXml)
|
||||
where TEvent : WechatWorkEvent, WechatWorkEvent.Types.IXmlSerializable, new()
|
||||
{
|
||||
if (client == null) throw new ArgumentNullException(nameof(client));
|
||||
if (string.IsNullOrEmpty(callbackXml)) throw new ArgumentNullException(callbackXml);
|
||||
|
||||
using StringReader reader = new StringReader(callbackXml);
|
||||
XmlSerializer xmlSerializer = new XmlSerializer(typeof(TEvent), new XmlRootAttribute("xml"));
|
||||
return (TEvent)xmlSerializer.Deserialize(reader);
|
||||
}
|
||||
}
|
||||
}
|
@@ -10,34 +10,73 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
[Serializable]
|
||||
public class WechatWorkEvent
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
[Newtonsoft.Json.JsonObject]
|
||||
public interface IJsonSerializable
|
||||
{
|
||||
}
|
||||
|
||||
[System.Xml.Serialization.XmlRoot("xml")]
|
||||
public interface IXmlSerializable
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业 CorpId。
|
||||
/// 获取或设置企业 CorpId 或第三方应用的 SuiteId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("ToUserName")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("ToUserName")]
|
||||
[XmlElement("ToUserName", IsNullable = true)]
|
||||
public string? ToUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置发送方账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("FromUserName")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("FromUserName")]
|
||||
[XmlElement("FromUserName", IsNullable = true)]
|
||||
public string? FromUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("MsgType")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("MsgType")]
|
||||
[XmlElement("MsgType", IsNullable = true)]
|
||||
public string? MessageType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置事件类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("Event")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("Event")]
|
||||
[XmlElement("Event", IsNullable = true)]
|
||||
public string? Event { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息创建时间。
|
||||
/// 获取或设置消息创建时间戳。
|
||||
/// </summary>
|
||||
[XmlElement("CreateTime")]
|
||||
public long CreateTimestamp { get; set; }
|
||||
[Newtonsoft.Json.JsonProperty("CreateTime")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("CreateTime")]
|
||||
[XmlElement("CreateTime", IsNullable = true)]
|
||||
public long? CreateTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[XmlElement("InfoType", IsNullable = true)]
|
||||
public string? InfoType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[XmlElement("TimeStamp", IsNullable = true)]
|
||||
public long? InfoTimestamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user