package protocol

//获取公司的榜单类型列表
type ResponseRankType struct {
	Id           int    `json:"id" orm:"column(id)"`
	Name         string `json:"name" orm:"column(name)"`
	EnableStatus int8   `json:"enable_status" orm:"column(enable_status)"`
	Type         int8   `json:"type" orm:"column(type)"`
}

// ResponseRankSeasonList 赛季列表
type ResponseRankSeasonList struct {
	ResponsePageInfo
	List []RankSeasonItem `json:"lists"`
}
type RankSeasonItem struct {
	Id        int64  `json:"id" orm:"column(id)"`
	Name      string `json:"name" orm:"column(season_name)"`
	BeginTime string `json:"begin_time" orm:"column(begin_time)"`
	EndTime   string `json:"end_time" orm:"column(end_time)"`
	Status    int8   `json:"status" orm:"column(status)"`
}

//RankRangeItem 赛季参与人列表项
type RankRangeItem struct {
	Id        int64  `json:"id"  orm:"column(id)"`
	Name      string `json:"name" orm:"column(name)"`
	RangeType int8   `json:"range_type"  orm:"column(type)"`
	Status    int8   `json:"status"  orm:"column(status)"`
	RangeData string `json:"range_data" orm:"-"`
}

//ResponseRankRangeInfo 赛季参与人详情
type ResponseRankRangeInfo struct {
	Id        int64               `json:"id"`
	Name      string              `json:"name"`
	RangeType int8                `json:"range_type"`
	Relation  []RankRangeRelation `json:"relation"`
}

type RankRangeRelation struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
}

//排行榜评比项
type RankItemInfo struct {
	ItemName string `json:"item_name"`
	ItemKey  string `json:"item_key"`
	SortNum  int    `json:"sort_num"`
}

type RankItemAll []RankItemInfo

func (a RankItemAll) Len() int      { return len(a) }
func (a RankItemAll) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a RankItemAll) Less(i, j int) bool {
	return a[i].SortNum < a[j].SortNum
}