2024-10-20 11:23:04 -04:00
|
|
|
package model
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
type StreamServer struct {
|
|
|
|
ID uint64 `json:"id,omitempty"`
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
PublicNote string `json:"public_note,omitempty"` // 公开备注,只第一个数据包有值
|
|
|
|
DisplayIndex int `json:"display_index,omitempty"` // 展示排序,越大越靠前
|
|
|
|
|
2024-11-26 08:30:56 -05:00
|
|
|
Host *Host `json:"host,omitempty"`
|
|
|
|
State *HostState `json:"state,omitempty"`
|
|
|
|
CountryCode string `json:"country_code,omitempty"`
|
|
|
|
LastActive time.Time `json:"last_active,omitempty"`
|
2024-10-20 11:23:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
type StreamServerData struct {
|
|
|
|
Now int64 `json:"now,omitempty"`
|
2024-12-21 12:08:07 -05:00
|
|
|
Online int `json:"online,omitempty"`
|
2024-10-20 11:23:04 -04:00
|
|
|
Servers []StreamServer `json:"servers,omitempty"`
|
|
|
|
}
|
|
|
|
|
2024-10-21 11:00:51 -04:00
|
|
|
type ServerForm struct {
|
2024-10-20 11:23:04 -04:00
|
|
|
Name string `json:"name,omitempty"`
|
2024-11-26 08:30:56 -05:00
|
|
|
Note string `json:"note,omitempty" validate:"optional"` // 管理员可见备注
|
|
|
|
PublicNote string `json:"public_note,omitempty" validate:"optional"` // 公开备注
|
|
|
|
DisplayIndex int `json:"display_index,omitempty" default:"0"` // 展示排序,越大越靠前
|
|
|
|
HideForGuest bool `json:"hide_for_guest,omitempty" validate:"optional"` // 对游客隐藏
|
|
|
|
EnableDDNS bool `json:"enable_ddns,omitempty" validate:"optional"` // 启用DDNS
|
|
|
|
DDNSProfiles []uint64 `gorm:"-" json:"ddns_profiles,omitempty" validate:"optional"` // DDNS配置
|
2024-10-20 11:23:04 -04:00
|
|
|
}
|
2024-11-20 08:36:21 -05:00
|
|
|
|
|
|
|
type ForceUpdateResponse struct {
|
|
|
|
Success []uint64 `json:"success,omitempty" validate:"optional"`
|
|
|
|
Failure []uint64 `json:"failure,omitempty" validate:"optional"`
|
|
|
|
Offline []uint64 `json:"offline,omitempty" validate:"optional"`
|
|
|
|
}
|