package v1

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

type GlobalLimitSendRequest struct {
	Tag           string `json:"tag" form:"tag" binding:"required"`
	Bps           string `form:"bps" json:"bps" default:"0"`
	MaxBytesMonth string `form:"max_bytes_month" json:"max_bytes_month" default:"0"`
	ExpiredAt     string `form:"expired_at" json:"expired_at omitempty"`
	Comment       string `form:"comment" json:"comment"`
}

type GlobalLimitRequireResponse struct {
	ExpiredAt       string
	GlobalLimitName string
	HostName        string
	Bps             string
	MaxBytesMonth   string
	IpCount   int
	Operator int
}

type GeneralLimitRequireRequest struct {
	Uid    int    `json:"uid" form:"uid" binding:"required"`
	HostId int    `json:"host_id" form:"host_id" binding:"required"`
	Tag    string `json:"tag" form:"tag" binding:"required"`
	RuleId int    `json:"rule_id" form:"rule_id" 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:"host_id" form:"host_id" gorm:"column:host_id"`
	RuleId int `json:"rule_id" form:"rule_id" gorm:"column:rule_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 GlobalLimitExpiredBySnail struct {
	HostId int `json:"host_id" form:"host_id" gorm:"column:waf_common_limit_id"`
	ExpiredAt int64 `json:"expired_at" form:"expired_at" gorm:"column:expired_at"`
}

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