using SqlSugar; using Volo.Abp.Domain.Entities.Auditing; namespace Yi.Framework.DigitalCollectibles.Domain.Entities; /// /// 挂机表 /// 表示用户与挂机道具之间的关系 /// 用于定时任务处理自动挖矿 /// [SugarTable("DC_OnHook")] public class OnHookAggregateRoot : FullAuditedAggregateRoot { public OnHookAggregateRoot() { } public OnHookAggregateRoot(Guid userId, int effectiveHours) { UserId = userId; EffectiveHours = effectiveHours; StarTime = DateTime.Now; EndTime = DateTime.Now.AddHours(effectiveHours); IsActive = true; } /// /// 用户id /// public Guid UserId { get; set; } /// /// 开始时间 /// public DateTime? StarTime { get; set; } /// /// 结束时间 /// public DateTime? EndTime { get; set; } /// /// 有效小时数 /// public int EffectiveHours { get; set; } /// /// 是否激活 /// public bool IsActive { get; set; } }