
// ControlServer 服务器管理表
type ControlServer struct {
	ID        uint           `gorm:"primarykey" json:"id"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at,omitempty"`

	// 服务器唯一标识
	ServerIdentity string `gorm:"type:varchar(255);not null;uniqueIndex" json:"server_identity"` // 服务器唯一标识

	// 服务器基本信息
	Name        string `gorm:"type:varchar(100);not null" json:"name"` // 服务器名称
	IPAddress   string `gorm:"type:varchar(50)" json:"ip_address"`     // IP地址
	Description string `gorm:"type:text" json:"description"`           // 描述信息

	// 服务器类型和标签
	OS         string `gorm:"type:varchar(50)" json:"os"`          // 操作系统: Windows/Linux/Mac/Other
	OSVersion  string `gorm:"type:varchar(50)" json:"os_version"`  // 操作系统版本: 10.0.19041.1/18.04.5/14.1.0/Other
	Kernel     string `gorm:"type:varchar(50)" json:"kernel"`      // 内核类型：x86/arm
	ServerType string `gorm:"type:varchar(50)" json:"server_type"` // 服务器类型: physical/virtual/cloud
	Tags       string `gorm:"type:varchar(500)" json:"tags"`       // 标签:PC/Server
	Location   string `gorm:"type:varchar(200)" json:"location"`   // 位置/机房信息

	// 远程访问
	RemoteAccess string `gorm:"type:varchar(255)" json:"remote_access"` // 远程访问
	AgentConfig  string `gorm:"type:varchar(255)" json:"agent_config"`  // Agent配置

	// 状态信息
	Status        string    `gorm:"type:varchar(20);not null;default:unknown" json:"status"` // 状态: online/offline/unknown
	LastCheckTime time.Time `json:"last_check_time"`                                         // 最后检查时间

	// 采集器配置
	CollectOn         bool   `gorm:"default:true" json:"collect_on"`                // 是否启用采集
	CollectArgs       string `gorm:"type:varchar(255)" json:"collect_args"`         // 采集参数
	CollectInterval   int    `gorm:"default:60" json:"collect_interval"`            // 采集间隔（秒）
	CollectLastResult string `gorm:"type:varchar(2000)" json:"collect_last_result"` // 采集最后结果
}