using JNPF.EventBus; using JNPF.TaskScheduler.Entitys; using SqlSugar; namespace JNPF.EventHandler; /// /// 日记事件源(事件承载对象). /// public class TaskLogEventSource : IEventSource { /// /// 构造函数. /// /// 事件ID. /// 数据库连接配置. /// 实体. public TaskLogEventSource(string eventId, ConnectionConfigOptions connectionConfig, TimeTaskLogEntity entity) { EventId = eventId; ConnectionConfig = connectionConfig; Entity = entity; } /// /// 数据库连接配置. /// public ConnectionConfigOptions ConnectionConfig { get; set; } /// /// 日记实体. /// public TimeTaskLogEntity Entity { get; set; } /// /// 事件 Id. /// public string EventId { get; } /// /// 事件承载(携带)数据. /// public object Payload { get; } /// /// 取消任务 Token. /// /// 用于取消本次消息处理. public CancellationToken CancellationToken { get; } /// /// 事件创建时间. /// public DateTime CreatedTime { get; } = DateTime.UtcNow; }