| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- namespace Admin.NET.Plugin.AiDOP.Entity.S8;
- /// <summary>
- /// S8-NOTIFY-RECIPIENT-1:「某条规则的某个事件发生时,通知谁」。
- ///
- /// <para><b>身份是 (tenant_id, rule_code, event_code, recipient_type)</b>。
- /// <c>rule_code = '*'</c> 表示<b>租户级默认</b>,用于没有来源规则的异常(人工提报);
- /// 用显式哨兵而不是 NULL,是因为 NULL 在唯一索引里的比较语义会让人配出两条"默认"
- /// 而互不冲突。</para>
- ///
- /// <para><b>取代旧的 <c>ado_s8_notification_layer</c> 成为 CURRENT AUTHORITY。</b>
- /// 旧表按 <c>(scene_code, severity, level_code)</c> 组织,其中 level_code 的
- /// L1/L2/L3 三档在库里只有 L1 被真正用过,且「主管 / 总监」在系统中没有对应实体;
- /// 更关键的是它<b>不按规则</b>,无法回答「这条规则出事通知谁」。
- /// 旧表降级为 fallback:仅当本表对该 (租户, 规则, 事件) 没有任何配置时才使用,
- /// 且在页面上标注 LEGACY。优先级单一、可解释,不是两个平级 authority。</para>
- /// </summary>
- [SugarTable("ado_s8_notification_recipient", "S8 通知收件人配置")]
- [SugarIndex("uk_s8_notify_recipient", nameof(TenantId), OrderByType.Asc, nameof(RuleCode), OrderByType.Asc, nameof(EventCode), OrderByType.Asc, nameof(RecipientType), OrderByType.Asc, IsUnique = true)]
- public class AdoS8NotificationRecipient
- {
- [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")]
- public long Id { get; set; }
- /// <summary>租户。<b>唯一安全边界</b>;工厂不参与。</summary>
- [SugarColumn(ColumnName = "tenant_id", ColumnDataType = "bigint")]
- public long TenantId { get; set; }
- /// <summary>规则编码;<c>'*'</c> = 租户级默认(无来源规则的异常走这一条)。</summary>
- [SugarColumn(ColumnName = "rule_code", Length = 128)]
- public string RuleCode { get; set; } = string.Empty;
- /// <summary>事件码,取值须在 <c>S8NotificationCatalog.Events</c> 内。</summary>
- [SugarColumn(ColumnName = "event_code", Length = 64)]
- public string EventCode { get; set; } = string.Empty;
- /// <summary>收件人类型,取值须在 <c>S8NotificationCatalog.RecipientTypes</c> 内。</summary>
- [SugarColumn(ColumnName = "recipient_type", Length = 32)]
- public string RecipientType { get; set; } = string.Empty;
- /// <summary>
- /// 仅 <c>SPECIFIC_USER</c> 使用:逗号分隔的 <c>SysUser.Id</c>。
- /// 其余类型为空 —— 它们的人选在派发那一刻由上下文解析,不预存。
- /// </summary>
- [SugarColumn(ColumnName = "recipient_user_ids", Length = 2000, IsNullable = true)]
- public string? RecipientUserIds { get; set; }
- [SugarColumn(ColumnName = "created_at")]
- public DateTime CreatedAt { get; set; } = DateTime.Now;
- [SugarColumn(ColumnName = "created_by", Length = 64, IsNullable = true)]
- public string? CreatedBy { get; set; }
- }
|