48 lines
861 B
C#
48 lines
861 B
C#
using Cowain.Base.DBContext;
|
|
using Cowain.Base.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Plugin.Cowain.Driver.Models.Enum;
|
|
using System.ComponentModel;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Plugin.Cowain.Driver.Models.Dto;
|
|
|
|
[Table("alarm_group")]
|
|
public class AlarmGroupDto : BaseModel
|
|
{
|
|
[Key]
|
|
public int Id { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// 报警组名称
|
|
/// </summary>
|
|
[Required]
|
|
[MaxLength(200)]
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
public class AlarmGroupSeed : IDataSeeding
|
|
{
|
|
public void DataSeeding(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.Entity<AlarmGroupDto>().HasData(
|
|
new AlarmGroupDto
|
|
{
|
|
Id = 1,
|
|
Name = "系统"
|
|
});
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|