xiangning 6c110b579a refactor(dependencies): 移除未使用的域实体引用
- 从文件模块的多部分上传处理器中移除未使用的实体引用
- 从即时通讯模块的群组成员处理器中移除未使用的实体引用
- 从RAG模块的AI模型配置中移除未使用的实体引用
- 从监控模块的告警规则配置中移除未使用的实体引用
- 从平台模块的角色权限处理器中移除未使用的实体引用
- 从脚本模块的执行日志实体引用中进行清理
- 从多个基础设施配置类中移除未使用的依赖项
- 优化测试文件中的导入声明,移除不必要的引用
2026-07-19 14:09:47 +08:00

29 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Monitoring.Domain.Entities.AlertRule;
namespace Monitoring.Infrastructure.Persistence.Configurations;
/// <summary>告警规则表映射(id + 外键索引列 + json_data + 审计)。</summary>
public class AlertRuleConfiguration : IEntityTypeConfiguration<AlertRuleEntity>
{
public void Configure(EntityTypeBuilder<AlertRuleEntity> builder)
{
builder.ToTable("b_alert_rules");
builder.HasKey(e => e.Id);
builder.Property(e => e.Id).ValueGeneratedNever().HasComment("规则ID");
builder.Property(e => e.ExternalSystemId).HasComment("绑定的外部系统ID");
builder.Property(e => e.JsonData).HasColumnType("jsonb").IsRequired().HasComment("业务数据: 名称/指标/阈值/运算符/严重级别/启用/冷却");
// 审计列
builder.Property(e => e.CreatedBy).HasMaxLength(100).HasComment("创建人");
builder.Property(e => e.CreatedAt).HasComment("创建时间");
builder.Property(e => e.UpdatedBy).HasMaxLength(100).HasComment("更新人");
builder.Property(e => e.UpdatedAt).HasComment("更新时间");
builder.Property(e => e.IsDeleted).HasDefaultValue(false).HasComment("是否已软删除");
builder.Property(e => e.OperatorIP).HasMaxLength(50).HasComment("操作者IP");
builder.HasIndex(e => e.ExternalSystemId);
}
}