package model import ( "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/os/gtime" "github.com/gogf/gf/v2/util/gmeta" ) type NodeCreateInput struct { Name string Host string Port int Url string PingType int UrlStatus int } type NodeConfigAndEditCreateInput struct { ServerId int SshCom string SshPass string SshUser string } // node_count //node_loos type PingConfigEditInput struct { NodeDie int NodeCount int NodeLoos int PingTime int PingName string NodeRecover int } type NodeEditInput struct { Id int Name string Host string Port int Url string UrlRecover string PingType int UrlStatus int IsNotice int } type NodeDelInput struct { Id int } type NodeUpdateInput struct { ServerId int NodeMs int } // EntityNodePingLog PINGLOGN表 type EntityNodePingLog struct { gmeta.Meta `orm:"table:pinglog"` Serverid int `json:"serverid"` Avgdelay string `json:"avgdelay"` // 平均延迟 CreateAt *gtime.Time `json:"createAt" description:"创建时间"` // 创建时间 } // EntityNodeInfo 组合模型,用户信息 type EntityNodeInfo struct { gmeta.Meta `orm:"table:node"` Id int `orm:"id" json:"id"` Name string `orm:"name"` Host string `orm:"host"` } // 组合模型,用户信息 type UserItem struct { Node *EntityNodeInfo PingLog []*EntityNodePingLog } type EntityNodeConfigInfo struct { g.Meta `orm:"table:nodeconfig"` Id interface{} // ID主键 Serverid interface{} // 服务器ID Sshcommand interface{} // 服务器执行命令 Sshpassword interface{} // 服务器密码 Sshusername interface{} // ssh账号 } type NodeInfo struct { g.Meta `orm:"table:node"` Id int `json:"id" description:"ID主键自动添加"` // ID主键自动添加 Name string `json:"name" description:"服务器名称"` // 服务器名称 Host string `json:"host" description:"服务器IP"` // 服务器IP Port int `json:"port" description:"服务器端口"` // 服务器端口 Url string `json:"url" description:"服务器切换地址"` // 服务器切换地址 UrlRecover string `json:"UrlRecover" description:"服务器恢复地址"` // 服务器切换地址 UpdateAt *gtime.Time `json:"updateAt" description:"更新时间"` // 更新时间 CreateAt *gtime.Time `json:"createAt" description:"创建时间"` // 创建时间 PingType int `json:"pingType" description:"服务器延迟类型 0 icmp 1 tcp"` // 服务器延迟类型 0 icmp 1 tcp UrlStatus int `json:"urlStatus" description:"用于表示url是否执行完成"` // 用于表示url是否执行完成 NodeMs int `json:"nodeMs" description:"服务器延迟"` // 服务器延迟 UrlCount int `json:"urlCount" description:"用于服务器切换IP执行次数"` // 用于服务器切换IP执行次数 UrlRet string `json:"urlRet" description:"切换服务器放回结果"` // 切换服务器放回结果 IsNotice int `json:"isNotice" description:"是否通知到电报"` // 是否通知到电报 } // 组合模型,用户信息 type NodeConfigItem struct { Node *NodeInfo NodeConfig []*EntityNodeConfigInfo }