AdoS8NotificationLayer.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. namespace Admin.NET.Plugin.AiDOP.Entity.S8;
  2. [SugarTable("ado_s8_notification_layer", "S8 通知分层")]
  3. public class AdoS8NotificationLayer
  4. {
  5. [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")]
  6. public long Id { get; set; }
  7. [SugarColumn(ColumnName = "tenant_id", ColumnDataType = "bigint")]
  8. public long TenantId { get; set; }
  9. [SugarColumn(ColumnName = "factory_id", ColumnDataType = "bigint")]
  10. public long FactoryId { get; set; }
  11. [SugarColumn(ColumnName = "scene_code", Length = 64)]
  12. public string SceneCode { get; set; } = string.Empty;
  13. /// <summary>S8 业务枚举 FOLLOW(关注)/ SERIOUS(严重)。</summary>
  14. [SugarColumn(ColumnName = "severity", Length = 32)]
  15. public string Severity { get; set; } = "FOLLOW";
  16. [SugarColumn(ColumnName = "level_code", Length = 32)]
  17. public string LevelCode { get; set; } = string.Empty;
  18. [SugarColumn(ColumnName = "target_role_ids", Length = 2000, IsNullable = true)]
  19. public string? TargetRoleIds { get; set; }
  20. [SugarColumn(ColumnName = "notify_channel", Length = 128, IsNullable = true)]
  21. public string? NotifyChannel { get; set; }
  22. [SugarColumn(ColumnName = "created_at")]
  23. public DateTime CreatedAt { get; set; } = DateTime.Now;
  24. [SugarColumn(ColumnName = "updated_at", IsNullable = true)]
  25. public DateTime? UpdatedAt { get; set; }
  26. /// <summary>
  27. /// S8-STEP6C-CFG-NOTIFY-CLOSURE-1:作用域标识(不落库)。
  28. /// GLOBAL = 平台默认 (0,0),租户侧只读;FACTORY = 当前工厂自有行。
  29. /// </summary>
  30. [SugarColumn(IsIgnore = true)]
  31. public string Scope => Admin.NET.Plugin.AiDOP.Infrastructure.S8ConfigScope.Resolve(TenantId, FactoryId);
  32. /// <summary>
  33. /// S8-STEP6C-CFG-NOTIFY-FIX-AND-CERT-1:本行所属 (scene_code, severity, level_code) 键是否存在平台默认行
  34. /// (不落库,由 ListAsync 赋值)。
  35. ///
  36. /// 含义与 exception_type / role_permission 等「逐行覆盖」对象**一致**:
  37. /// 「本工厂这一行覆盖了同键的平台默认行」。
  38. ///
  39. /// ⚠️ 修正记录:S8-STEP6C-CFG-NOTIFY-CLOSURE-1 版本下覆盖粒度曾是整个 (scene, severity) 键
  40. /// (resolver 精确命中该键即完全不读 (0,0)),本标记当时的含义是「本工厂一旦自建行就整键接管」。
  41. /// 该语义已被 S8NotificationLayerMerge 收敛为逐 level 覆盖,本注释同批修正。
  42. /// </summary>
  43. [SugarColumn(IsIgnore = true)]
  44. public bool HasGlobalDefault { get; set; }
  45. }