添加项目文件。

This commit is contained in:
zel
2025-03-05 19:42:01 +08:00
parent 659f1a2ad9
commit 47dcdeb55d
582 changed files with 242004 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
using Jaina;
using System.Threading;
using System;
using WaterCloud.Code;
namespace WaterCloud.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; }
public bool IsConsumOnce => true;
}
}