using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AmtScanner.Api.Models;
///
/// 操作系统设备实体
///
public class OsDevice
{
[Key]
public long Id { get; set; }
///
/// IP 地址
///
[Required]
public string IpAddress { get; set; } = string.Empty;
///
/// 系统 UUID(SMBIOS UUID,用于与 AMT 绑定)
///
public string? SystemUuid { get; set; }
///
/// 主机名
///
public string? Hostname { get; set; }
///
/// 操作系统类型
///
public OsType OsType { get; set; } = OsType.Unknown;
///
/// 操作系统版本
///
public string? OsVersion { get; set; }
///
/// 操作系统架构
///
public string? Architecture { get; set; }
///
/// 当前登录用户
///
public string? LoggedInUser { get; set; }
///
/// 系统最后启动时间
///
public DateTime? LastBootTime { get; set; }
///
/// MAC 地址
///
public string? MacAddress { get; set; }
///
/// 是否在线
///
public bool IsOnline { get; set; }
///
/// 最后在线时间
///
public DateTime? LastOnlineAt { get; set; }
///
/// 发现时间
///
public DateTime DiscoveredAt { get; set; } = DateTime.UtcNow;
///
/// 最后更新时间
///
public DateTime LastUpdatedAt { get; set; } = DateTime.UtcNow;
///
/// 备注
///
public string? Description { get; set; }
///
/// 关联的 AMT 设备 ID
///
public long? AmtDeviceId { get; set; }
///
/// 关联的 AMT 设备
///
[ForeignKey(nameof(AmtDeviceId))]
public AmtDevice? AmtDevice { get; set; }
}
public enum OsType
{
Unknown = 0,
Windows = 1,
Linux = 2,
MacOS = 3
}