package v1

import "time"

type GameShieldBackendRequest struct {
	Id              int       `json:"id" form:"id"`
	SourceMachineIP string    `json:"source_machineIP" form:"source_machineIP"`
	Protocol        string    `json:"protocol" form:"protocol"`
	ProxyAddr       string    `json:"proxy_addr" form:"proxy_addr"`
	KeySort         int       `json:"key_sort" form:"key_sort"`
	ConnectPort     string    `json:"connect_port" form:"connect_port" binding:"required"`
	SdkPort         string    `json:"sdk_port" form:"sdk_port"`
	SdkIp           string    `json:"sdk_ip" form:"sdk_ip"`
	Type            string    `json:"type" form:"type"`
	MaxBandwidth    *int      `json:"max_bandwidth" form:"max_bandwidth"`
	RealIp          string    `json:"real_ip" form:"real_ip"`
	Host            string    `json:"host" form:"host" binding:"required"`
	Remark          string    `json:"remark" form:"remark"`
	CreatedAt       time.Time `json:"created_at" form:"created_at"`
	UpdatedAt       time.Time `json:"updated_at" form:"updated_at"`
}

type GameShieldBackendArrayRequest struct {
	Items  []GameShieldBackendRequest `json:"items" form:"items"`
	Uid    int                        `json:"uid" form:"uid" binding:"required"`
	HostId int                        `json:"host_id" form:"host_id" binding:"required"`
}

type SendGameShieldBackend struct {
	Addr              []string `json:"addr,omitempty" form:"addr"`
	Protocol          string   `json:"protocol,omitempty" form:"protocol"`
	ProxyAddr         string   `json:"proxy_addr,omitempty" form:"proxy_addr"`
	SdkPort           int      `json:"sdk_port,omitempty" form:"sdk_port"`
	UdpSessionTimeout string   `json:"udp_session_timeout,omitempty" form:"udp_session_timeout"`
	SdkIp             string   `json:"sdk_ip,omitempty" form:"sdk_ip"`
	AgentAddr         string   `json:"agent_addr,omitempty" form:"agent_addr"`
	Type              string   `json:"type,omitempty" form:"type"`
	MaxBandwidth      string   `json:"max_bandwidth,omitempty" form:"max_bandwidth"`
	Host              string   `json:"host,omitempty" form:"host"`
	Remark            string   `json:"remark,omitempty" form:"remark"`
}

type DelGameShieldBackendRequest struct {
	Ids    []int `json:"ids" form:"ids" binding:"required"`
	Uid    int   `json:"uid" form:"uid" binding:"required"`
	HostId int   `json:"host_id" form:"host_id" binding:"required"`
}

type ReplacementSourceMachineIpRequest struct {
	OldSourceMachineIp string `json:"old_source_machine_ip" form:"old_source_machine_ip"`
	NewSourceMachineIp string `json:"new_source_machine_ip" form:"new_source_machine_ip"`
	Uid                int    `json:"uid" form:"uid" binding:"required"`
	HostId             int    `json:"host_id" form:"host_id" binding:"required"`
}
