| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- namespace Admin.NET.Plugin.AiDOP.Entity.S8;
- // S8-NOTIFY-RECIPIENT-1:本表自 1.0.500 起降级为 LEGACY fallback。
- // CURRENT AUTHORITY 是 ado_s8_notification_recipient(按 规则 + 事件 组织)。
- // 标记写在这里而不是只写进 migration —— CodeFirst 的 InitTables 会在启动时按实体描述
- // 回写表注释,迁移里的 ALTER ... COMMENT 会被它覆盖(本地实测:1.0.500 执行成功,
- // 但重启后注释仍是旧文案)。
- [SugarTable("ado_s8_notification_layer", "[LEGACY] S8 通知分层(CURRENT AUTHORITY = ado_s8_notification_recipient;仅在新表无配置时 fallback)")]
- public class AdoS8NotificationLayer
- {
- [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")]
- public long Id { get; set; }
- [SugarColumn(ColumnName = "tenant_id", ColumnDataType = "bigint")]
- public long TenantId { get; set; }
- [SugarColumn(ColumnName = "factory_id", ColumnDataType = "bigint")]
- public long FactoryId { get; set; }
- [SugarColumn(ColumnName = "scene_code", Length = 64)]
- public string SceneCode { get; set; } = string.Empty;
- /// <summary>S8 业务枚举 FOLLOW(关注)/ SERIOUS(严重)。</summary>
- [SugarColumn(ColumnName = "severity", Length = 32)]
- public string Severity { get; set; } = "FOLLOW";
- [SugarColumn(ColumnName = "level_code", Length = 32)]
- public string LevelCode { get; set; } = string.Empty;
- [SugarColumn(ColumnName = "target_role_ids", Length = 2000, IsNullable = true)]
- public string? TargetRoleIds { get; set; }
- [SugarColumn(ColumnName = "notify_channel", Length = 128, IsNullable = true)]
- public string? NotifyChannel { get; set; }
- [SugarColumn(ColumnName = "created_at")]
- public DateTime CreatedAt { get; set; } = DateTime.Now;
- [SugarColumn(ColumnName = "updated_at", IsNullable = true)]
- public DateTime? UpdatedAt { get; set; }
- /// <summary>
- /// S8-STEP6C-CFG-NOTIFY-CLOSURE-1:作用域标识(不落库)。
- /// GLOBAL = 平台默认 (0,0),租户侧只读;FACTORY = 当前工厂自有行。
- /// </summary>
- [SugarColumn(IsIgnore = true)]
- public string Scope => Admin.NET.Plugin.AiDOP.Infrastructure.S8ConfigScope.Resolve(TenantId, FactoryId);
- /// <summary>
- /// S8-STEP6C-CFG-NOTIFY-FIX-AND-CERT-1:本行所属 (scene_code, severity, level_code) 键是否存在平台默认行
- /// (不落库,由 ListAsync 赋值)。
- ///
- /// 含义与 exception_type / role_permission 等「逐行覆盖」对象**一致**:
- /// 「本工厂这一行覆盖了同键的平台默认行」。
- ///
- /// ⚠️ 修正记录:S8-STEP6C-CFG-NOTIFY-CLOSURE-1 版本下覆盖粒度曾是整个 (scene, severity) 键
- /// (resolver 精确命中该键即完全不读 (0,0)),本标记当时的含义是「本工厂一旦自建行就整键接管」。
- /// 该语义已被 S8NotificationLayerMerge 收敛为逐 level 覆盖,本注释同批修正。
- /// </summary>
- [SugarColumn(IsIgnore = true)]
- public bool HasGlobalDefault { get; set; }
- }
|