Files
collector/internal/models/collect_node.go

29 lines
1.0 KiB
Go
Raw Normal View History

package models
import (
"time"
"git.apinb.com/bsm-sdk/core/database"
)
// CollectorNode 节点状态数据库模型
type CollectorNode struct {
ID uint `json:"id" gorm:"primaryKey;comment:主键ID"`
ConfigKey string `json:"config_key" gorm:"type:varchar(100);not null;uniqueIndex;comment:配置键"`
HomeName string `json:"home_name" gorm:"type:varchar(100);not null;comment:主机名称"`
ProjectRoot string `json:"project_root" gorm:"type:varchar(500);not null;comment:项目根目录"`
QmtStatus string `json:"qmt_status" gorm:"type:varchar(50);not null;comment:QMT连接状态"`
StartTime int64 `json:"start_time" gorm:"not null;comment:启动时间戳(纳秒)"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime;comment:记录更新时间"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime;comment:记录创建时间"`
}
func init() {
database.AppendMigrate(&CollectorNode{})
}
// TableName 设置表名
func (CollectorNode) TableName() string {
return "collector_node"
}