2020-09-01 10:34:11 +08:00
|
|
|
package vo
|
|
|
|
|
|
2023-03-06 16:59:57 +08:00
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// 授权凭证基础信息
|
|
|
|
|
type AuthCertBaseVO struct {
|
|
|
|
|
Id int `json:"id"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
AuthMethod int8 `json:"authMethod"`
|
|
|
|
|
}
|
2020-09-01 10:34:11 +08:00
|
|
|
|
|
|
|
|
type MachineVO struct {
|
2023-03-06 16:59:57 +08:00
|
|
|
Id uint64 `json:"id"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Ip string `json:"ip"`
|
|
|
|
|
Port int `json:"port"`
|
|
|
|
|
Username string `json:"username"`
|
|
|
|
|
AuthCertId int `json:"authCertId"`
|
2022-07-23 16:41:04 +08:00
|
|
|
Status *int8 `json:"status"`
|
2023-03-06 16:59:57 +08:00
|
|
|
SshTunnelMachineId int `json:"sshTunnelMachineId"` // ssh隧道机器id
|
2022-07-23 16:41:04 +08:00
|
|
|
CreateTime *time.Time `json:"createTime"`
|
|
|
|
|
Creator *string `json:"creator"`
|
|
|
|
|
CreatorId *int64 `json:"creatorId"`
|
|
|
|
|
UpdateTime *time.Time `json:"updateTime"`
|
|
|
|
|
Modifier *string `json:"modifier"`
|
|
|
|
|
ModifierId *int64 `json:"modifierId"`
|
|
|
|
|
HasCli bool `json:"hasCli" gorm:"-"`
|
|
|
|
|
Remark *string `json:"remark"`
|
2022-08-29 21:43:24 +08:00
|
|
|
EnableRecorder int8 `json:"enableRecorder"`
|
2022-10-26 20:49:29 +08:00
|
|
|
TagId uint64 `json:"tagId"`
|
|
|
|
|
TagPath string `json:"tagPath"`
|
2020-09-01 10:34:11 +08:00
|
|
|
}
|
|
|
|
|
|
2021-05-08 18:00:33 +08:00
|
|
|
type MachineScriptVO struct {
|
|
|
|
|
Id *int64 `json:"id"`
|
|
|
|
|
Name *string `json:"name"`
|
|
|
|
|
Script *string `json:"script"`
|
|
|
|
|
Type *int `json:"type"`
|
|
|
|
|
Description *string `json:"description"`
|
2021-07-28 18:03:19 +08:00
|
|
|
Params *string `json:"params"`
|
2021-05-08 18:00:33 +08:00
|
|
|
MachineId *uint64 `json:"machineId"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type MachineFileVO struct {
|
|
|
|
|
Id *int64 `json:"id"`
|
|
|
|
|
Name *string `json:"name"`
|
|
|
|
|
Path *string `json:"path"`
|
|
|
|
|
Type *int `json:"type"`
|
|
|
|
|
MachineId *uint64 `json:"machineId"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type MachineFileInfo struct {
|
2023-07-05 00:26:00 +08:00
|
|
|
Name string `json:"name"`
|
|
|
|
|
Path string `json:"path"`
|
|
|
|
|
Size int64 `json:"size"`
|
|
|
|
|
Type string `json:"type"`
|
2021-05-08 18:00:33 +08:00
|
|
|
}
|
|
|
|
|
|
2022-09-26 18:08:12 +08:00
|
|
|
type MachineFileInfos []MachineFileInfo
|
|
|
|
|
|
|
|
|
|
func (s MachineFileInfos) Len() int { return len(s) }
|
|
|
|
|
|
|
|
|
|
func (s MachineFileInfos) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
|
|
|
|
|
|
|
|
|
func (s MachineFileInfos) Less(i, j int) bool {
|
|
|
|
|
if s[i].Type != s[j].Type {
|
|
|
|
|
return s[i].Type > s[j].Type
|
|
|
|
|
}
|
|
|
|
|
return s[i].Name < s[j].Name
|
2020-09-01 10:34:11 +08:00
|
|
|
}
|