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 {
}