using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using detect.gui.Commons; using Microsoft.EntityFrameworkCore; namespace detect.gui.Models.Entities; [Table("Device")] [Index(nameof(Name), IsUnique = true)] public class DeviceEntity { [Key] public long? Id { get; set; } [StringLength(255), Comment("设备名称")] public string? Name { get; set; } [StringLength(20), Comment("设备IP地址")] [RegularExpression(RegexHelper.IpV4, ErrorMessage = "IpV4: {0}格式非法")] public string? DeviceIp { get; set; } [StringLength(6), Comment("设备端口")] public string? DevicePort { get; set; } [StringLength(255), Comment("用户名")] public string? DeviceUsername { get; set; } [StringLength(255), Comment("密码")] public string? DevicePassword { get; set; } [StringLength(255), Comment("设备类型")] public string? DeviceType { get; set; } [StringLength(50), Comment("软件版本")] public string? SoftwareVersion { get; set; } [StringLength(50), Comment("固件版本")] public string? FirmwareVersion { get; set; } [StringLength(50), Comment("算法版本")] public string? AlgorithmVersion { get; set; } [StringLength(50), Comment("模型版本")] public string? ModelVersion { get; set; } [StringLength(20), Comment("相机IP地址")] [RegularExpression(RegexHelper.IpV4, ErrorMessage = "IpV4: {0}格式非法")] public string? CameraIp { get; set; } [StringLength(255), Comment("相机用户名")] public string? CameraUsername { get; set; } [StringLength(255), Comment("相机密码")] public string? CameraPassword { get; set; } [StringLength(255), Comment("相机rtsp完整地址")] [RegularExpression(RegexHelper.Url, ErrorMessage = "Rtsp: {0}格式非法")] public string? CameraRtsp { get; set; } [StringLength(255), Comment("检测类型")] public string? AssayType { get; set; } [Comment("创建时间")] public DateTime? CreateTime { get; set; } [Comment("更新时间")] public DateTime? UpdateTime { get; set; } }