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