2022-08-18 18:54:21 +08:00
|
|
|
package dto
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
type HostCreate struct {
|
2022-08-23 15:21:08 +08:00
|
|
|
Name string `json:"name" validate:"required"`
|
2022-08-18 18:54:21 +08:00
|
|
|
Addr string `json:"addr" validate:"required,ip"`
|
|
|
|
Port uint `json:"port" validate:"required,number,max=65535,min=1"`
|
|
|
|
User string `json:"user" validate:"required"`
|
|
|
|
AuthMode string `json:"authMode" validate:"oneof=password key"`
|
|
|
|
PrivateKey string `json:"privateKey"`
|
|
|
|
Password string `json:"password"`
|
|
|
|
|
|
|
|
Description string `json:"description"`
|
|
|
|
}
|
|
|
|
|
2022-08-29 18:44:35 +08:00
|
|
|
type SearchWithPage struct {
|
|
|
|
PageInfo
|
|
|
|
Info string `json:"info"`
|
|
|
|
}
|
|
|
|
|
2022-08-18 18:54:21 +08:00
|
|
|
type HostInfo struct {
|
|
|
|
ID uint `json:"id"`
|
|
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Addr string `json:"addr"`
|
|
|
|
Port uint `json:"port"`
|
|
|
|
User string `json:"user"`
|
|
|
|
AuthMode string `json:"authMode"`
|
|
|
|
|
|
|
|
Description string `json:"description"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type HostUpdate struct {
|
2022-08-23 15:21:08 +08:00
|
|
|
Name string `json:"name" validate:"required"`
|
2022-08-18 18:54:21 +08:00
|
|
|
Addr string `json:"addr" validate:"required,ip"`
|
|
|
|
Port uint `json:"port" validate:"required,number,max=65535,min=1"`
|
|
|
|
User string `json:"user" validate:"required"`
|
|
|
|
AuthMode string `json:"authMode" validate:"oneof=password key"`
|
|
|
|
PrivateKey string `json:"privateKey"`
|
|
|
|
Password string `json:"password"`
|
|
|
|
|
|
|
|
Description string `json:"description"`
|
|
|
|
}
|