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