using dy.net.model.dto; using SqlSugar; namespace dy.net.model.entity { [SugarTable(TableName = "dy_follow")] public class DouyinFollowed { /// /// /// [SugarColumn(IsPrimaryKey = true)] public string Id { get; set; } /// /// 博主sec_uid /// [SugarColumn(IsNullable = false, Length = 500)] public string SecUid { get; set; } [SugarColumn(IsNullable = false, Length = 200)] public string UperName { get; set; } [SugarColumn(IsNullable = true, Length = 1000)] public string UperAvatar { get; set; } /// /// 官方账号(企业认证) /// [SugarColumn(IsNullable = true, Length = 200)] public string Enterprise { get; set; } /// /// 是否开启同步 /// public bool OpenSync { get; set; } /// /// 是否全量同步 /// public bool FullSync { get; set; } /// /// 最后更新时间 /// public DateTime LastSyncTime { get; set; } /// /// 我的userId,关注者的抖音userid /// [SugarColumn(IsNullable = false, Length = 200)] public string mySelfId { get; set; } /// /// 签名 /// [SugarColumn(IsNullable = true, Length = 500)] public string Signature { get; set; } /// /// 同步文件保存路径 /// [SugarColumn(IsNullable = true, Length = 500)] public string SavePath { get; set; } /// /// 博主Id /// [SugarColumn(IsNullable = true, Length = 100)] public string UperId { get; set; } /// /// 标记为非关注的用户-手动增加的 /// public bool IsNoFollowed { get; set; } [SugarColumn(IsNullable = true, Length = 100)] public string DouyinNo { get; set; } /// /// 直播状态监测独立开关,不影响作品同步开关。 /// public bool LiveMonitorEnabled { get; set; } public DouyinLiveStatusState LiveStatus { get; set; } [SugarColumn(IsNullable = true, Length = 100)] public string LiveRoomId { get; set; } [SugarColumn(IsNullable = true, Length = 100)] public string LiveWebRid { get; set; } [SugarColumn(IsNullable = true, Length = 500)] public string LiveTitle { get; set; } [SugarColumn(IsNullable = true)] public DateTime? LiveCheckedAt { get; set; } [SugarColumn(IsNullable = true)] public DateTime? LiveStatusUpdatedAt { get; set; } [SugarColumn(IsNullable = true)] public DateTime? LiveStartedAt { get; set; } [SugarColumn(IsNullable = true, Length = 1000)] public string LiveCheckError { get; set; } public bool LiveEmailNotificationEnabled { get; set; } [SugarColumn(IsNullable = true, Length = 200)] public string LastLiveNotificationKey { get; set; } [SugarColumn(IsNullable = true)] public DateTime? LastLiveNotificationAttemptAt { get; set; } [SugarColumn(IsNullable = true)] public DateTime? LastLiveNotifiedAt { get; set; } [SugarColumn(IsNullable = true, Length = 1000)] public string LastLiveNotificationError { get; set; } [SugarColumn(IsIgnore = true)] public bool LiveStatusStale => LiveMonitorEnabled && (!LiveStatusUpdatedAt.HasValue || DateTime.Now - LiveStatusUpdatedAt.Value > TimeSpan.FromMinutes(10) || !string.IsNullOrWhiteSpace(LiveCheckError)); [SugarColumn(IsIgnore = true)] public string LiveRoomUrl => LiveStatus == DouyinLiveStatusState.Live && !string.IsNullOrWhiteSpace(LiveWebRid) ? "https://live.douyin.com/" + Uri.EscapeDataString(LiveWebRid) : null; } }