package v1

type GlobalLimitRequest struct {
	Uid     int    `json:"uid" form:"uid" binding:"required"`
	HostId  int    `json:"hostId" form:"hostId" binding:"required"`
	Comment string `json:"comment" form:"comment" binding:"required"`
}
type GlobalLimitEditRequest struct {
	Uid     int    `json:"uid" form:"uid" binding:"required"`
	HostId  int    `json:"hostId" form:"hostId" binding:"required"`
	RuleId  int    `json:"ruleId" form:"ruleId" binding:"required"`
	Comment string `json:"comment" form:"comment" binding:"required"`
	ExpiredAt int64 `json:"expired_at" form:"expired_at" binding:"required"`
}

type GlobalLimitRequireResponse struct {
	HostId          int
	ExpiredAt       string
	GlobalLimitName string
	HostName        string
	Bps             string
	MaxBytesMonth   string
	IpCount   int
	Operator int
	NodeArea      string
	ConfigMaxProtection string
	IsBanUdp       int
	IsBanOverseas int
}

type GeneralLimitRequireRequest struct {
	Uid    int    `json:"uid" form:"uid" binding:"required"`
	HostId int    `json:"hostId" form:"hostId" binding:"required"`
	Tag    string `json:"tag" form:"tag" binding:"required"`
	RuleId int    `json:"ruleId" form:"ruleId" binding:"required"`
}

type AccessRules struct {
	Mode string `json:"mode" form:"mode" default:"deny"`
	Default string   `json:"default" form:"default" default:"allow"`
	Rules   []AccessRuleRules `json:"rules" form:"rules"`
}

type AccessRuleRules struct {
	Rule   string `json:"rule" form:"rule"`
	Action string `json:"action" form:"action" default:"deny"`
}

type GlobalLimitExpired struct {
	HostId int `json:"hostId" form:"hostId" gorm:"column:host_id"`
	Comment string `json:"comment" form:"comment" gorm:"column:comment"`
}

type GlobalLimitExpiredByHost struct {
	Id int `json:"id" form:"id"`
	Nextduedate int64 `json:"nextduedate" form:"nextduedate"`
	Uid int64 `json:"uid" form:"uid"`
}



type UserInfo struct {
	Username string `json:"username" form:"username"`
	Email    string `json:"email" form:"email"`
	PhoneNumber    string `json:"phonenumber" form:"phonenumber"`
	LastLoginIp    string `json:"lastloginip" form:"lastloginip" gorm:"column:lastloginip"`
}
