添加项目文件。
This commit is contained in:
45
HT.Cloud.Service/Event/BaseEventSource.cs
Normal file
45
HT.Cloud.Service/Event/BaseEventSource.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using Jaina;
|
||||
using System.Threading;
|
||||
using System;
|
||||
using HT.Cloud.Code;
|
||||
|
||||
namespace HT.Cloud.Service.Event
|
||||
{
|
||||
public class BaseEventSource : IEventSource
|
||||
{
|
||||
public BaseEventSource()
|
||||
{
|
||||
}
|
||||
public BaseEventSource(string eventId, object payload, OperatorModel user = null)
|
||||
{
|
||||
EventId = eventId;
|
||||
Payload = payload;
|
||||
User = user;
|
||||
}
|
||||
// 自定义属性
|
||||
public string ToDoName { get; set; }
|
||||
/// <summary>
|
||||
/// 事件 Id
|
||||
/// </summary>
|
||||
public string EventId { get; set; }
|
||||
/// <summary>
|
||||
/// 事件承载(携带)数据
|
||||
/// </summary>
|
||||
public object Payload { get; set; }
|
||||
/// <summary>
|
||||
/// 事件创建时间
|
||||
/// </summary>
|
||||
public DateTime CreatedTime { get; set; } = DateTime.Now;
|
||||
/// <summary>
|
||||
/// 当前用户信息
|
||||
/// </summary>
|
||||
public OperatorModel User { get; set; }
|
||||
/// <summary>
|
||||
/// 取消任务 Token
|
||||
/// </summary>
|
||||
/// <remarks>用于取消本次消息处理</remarks>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public CancellationToken CancellationToken { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user