rank.go
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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
}