rank.go
2.1 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package protocol
const (
RankRangeTypeAllCompanyUser = 1
RankRangeTypeSpecifyUser = 2
RankRangeTypeAllCompanyDepartment = 3
RankRangeTypeAllSpecifyDepartment = 4
)
const (
RankPeriodWaiting = iota
RankPeriodBegin
RankPeriodEnd
)
/*GetRankList 排行榜*/
type GetRankListRequest struct {
RankTypeId int `json:"rankTypeId" valid:"Required"` //榜单类型编号(赛季榜、年榜)
RankRangeId int `json:"rankRangeId" valid:"Required"` //排行榜范围编号(员工/部门)
RankPeriodId int `json:"rankPeriodId" valid:"Required"` //排行榜周期范围编号 (开始结束时间)
PageIndex int `json:"pageIndex" valid:"Required"` //页码(默认0代表第1页)
PageSize int `json:"pageSize" valid:"Required"` //每页数量
}
type GetRankListResponse struct {
SortItems []string `json:"sortItems"` //评比项
Self []RankItem `json:"self"` //自己或所在部门的排名分数
Lists [][]RankItem `json:"lists"` //排名列表
Total int `json:"total"` //总数
}
type RankItem struct {
Ranking string `json:"ranking" orm:"column(ranking)"` //排名
Name string `json:"name,omitempty" orm:"column(name)"` //名称
Score float64 `json:"score" orm:"column(score)"` //分数
}
/*GetRankType */
type GetRankTypeRequest struct {
}
type GetRankTypeResponse struct {
List []NameItem `json:"rankTypes"`
}
type RankType struct {
Id int `json:"id"`
Name string `json:"name"`
}
/*GetRankRange */
type GetRankRangeRequest struct {
RankTypeId int `json:"rankTypeId" valid:"Required"`
}
type GetRankRangeResponse struct {
List []NameItem `json:"rankRanges"`
}
/*GetRankPeriods 获取榜单竞争范围列表*/
type GetRankPeriodsRequest struct {
RankTypeId int `json:"rankTypeId" valid:"Required"`
}
type GetRankPeriodsResponse struct {
List []RankPeriod `json:"rankPeriods"`
}
type RankPeriod struct {
Id int `json:"id"`
SeasonName string `json:"seasonName"`
BeginTime int64 `json:"beginTime"`
EndTime int64 `json:"endTime"`
}
/*ComputeRankScore */
type ComputeRankScoreRequest struct {
}
type ComputeRankScoreResponse struct {
}