Documentation ¶
Index ¶
- func SortPodiums(in []Podiums)
- type AddContestRequest
- type AddPreScoreRequest
- type AddScoreRequest
- type Bool
- type Client
- func (c *Client) AddContest(request AddContestRequest) error
- func (c *Client) AddPlayer(player model.Player) error
- func (c *Client) AddPlayerUser(player model.Player, user model.PlayerUser) error
- func (c *Client) AddPreScore(request AddPreScoreRequest) error
- func (c *Client) AddScore(req AddScoreRequest) error
- func (c *Client) BackToFile() error
- func (c *Client) EndContestScore(contestId uint) error
- func (c *Client) GetAllContestStatics() (contests []ContestStatics)
- func (c *Client) GetAllProjectBestScores() (bestSingle, bestAvg map[model.Project]model.Score)
- func (c *Client) GetAllProjectBestScoresByTimes(startTime, endTime time.Time) (bestSingle, bestAvg map[model.Project]model.Score)
- func (c *Client) GetAvgRelativeSor() map[model.SorStatisticsKey]RelativeSor
- func (c *Client) GetBestScore() (bestSingle, bestAvg map[model.Project][]model.Score)
- func (c *Client) GetBestScoreByProject(project model.Project) (bestSingle, bestAvg []model.Score)
- func (c *Client) GetBestScoreByTimes(startTime, endTime time.Time) (bestSingle, bestAvg map[model.Project][]model.Score)
- func (c *Client) GetContest(contestId uint) (contest model.Contest, err error)
- func (c *Client) GetContestPodiums(contestId uint) []Podiums
- func (c *Client) GetContestRecord(contestId uint) []RecordMessage
- func (c *Client) GetContestScore(contestId uint) map[model.Project][]RoutesScores
- func (c *Client) GetContestSor(contestId uint) (single, avg map[model.SorStatisticsKey][]SorScore)
- func (c *Client) GetContests(page, size int, typ string) (int64, []model.Contest, error)
- func (c *Client) GetPlayer(playerId uint) (PlayerDetail, error)
- func (c *Client) GetPlayerBestScore(playerId uint) (bestSingle, bestAvg map[model.Project]RankScore)
- func (c *Client) GetPlayerNemesis(playerID uint) NemesisDetails
- func (c *Client) GetPlayerPodiums(playerId uint) Podiums
- func (c *Client) GetPlayerRecord(playerId uint) []RecordMessage
- func (c *Client) GetPlayerRelativeSor(playerID uint) map[model.SorStatisticsKey]RelativeSor
- func (c *Client) GetPlayerScore(playerId uint) (bestSingle, bestAvg []model.Score, scores []ScoresByContest)
- func (c *Client) GetPlayerSor(playerId uint) (single, avg map[model.SorStatisticsKey]SorScore)
- func (c *Client) GetPlayerUser(player model.Player) model.PlayerUser
- func (c *Client) GetPlayers(page, size int) (int64, []model.Player, error)
- func (c *Client) GetPodiums() []Podiums
- func (c *Client) GetPreScores(page, size int, final Bool) (int64, []model.PreScore, error)
- func (c *Client) GetPreScoresByContest(contestID uint, page, size int, final Bool) (int64, []model.PreScore, error)
- func (c *Client) GetPreScoresByPlayer(playerID uint, page, size int, final Bool) (int64, []model.PreScore, error)
- func (c *Client) GetRecords(page, size int) (int64, []model.Record, error)
- func (c *Client) GetRelativeSor() (allPlayerSor map[model.SorStatisticsKey][]RelativeSor)
- func (c *Client) GetScoreByPlayerContest(playerId uint, contestId uint) ([]model.Score, error)
- func (c *Client) GetSor() (single, avg map[model.SorStatisticsKey][]SorScore)
- func (c *Client) ProcessPreScore(request ProcessPreScoreRequest) error
- func (c *Client) ReSetRecords() error
- func (c *Client) RemoveContest(contestId uint) error
- func (c *Client) RemovePlayer(playerId uint) error
- func (c *Client) RemoveScore(scoreID uint) error
- func (c *Client) UpdatePlayer(playerId uint, player model.Player) error
- func (c *Client) UpdatePlayerUser(player model.Player, user model.PlayerUser) error
- type ContestCore
- type ContestStatics
- type Core
- type CreateContestRequestRound
- type NemesisDetail
- type NemesisDetails
- type PlayerCore
- type PlayerDetail
- type PlayerUserCore
- type Podiums
- type PodiumsResult
- type ProcessPreScoreRequest
- type ProjectPlayer
- type RankScore
- type RecordMessage
- type RelativeSor
- type RoutesScores
- type ScoreCore
- type ScoresByContest
- type SorScore
- type StatisticalCore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortPodiums ¶
func SortPodiums(in []Podiums)
Types ¶
type AddContestRequest ¶
type AddPreScoreRequest ¶ added in v0.1.9
type AddPreScoreRequest struct { AddScoreRequest Source string `json:"Source"` Recorder string `json:"Recorder"` }
type AddScoreRequest ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddContest ¶
func (c *Client) AddContest(request AddContestRequest) error
func (*Client) AddPlayerUser ¶ added in v0.1.24
func (*Client) AddPreScore ¶ added in v0.1.9
func (c *Client) AddPreScore(request AddPreScoreRequest) error
func (*Client) BackToFile ¶ added in v0.5.4
func (*Client) EndContestScore ¶
func (*Client) GetAllContestStatics ¶ added in v0.2.1
func (c *Client) GetAllContestStatics() (contests []ContestStatics)
func (*Client) GetAllProjectBestScores ¶
func (*Client) GetAllProjectBestScoresByTimes ¶ added in v0.4.4
func (*Client) GetAvgRelativeSor ¶ added in v0.1.14
func (c *Client) GetAvgRelativeSor() map[model.SorStatisticsKey]RelativeSor
func (*Client) GetBestScore ¶
func (*Client) GetBestScoreByProject ¶
func (*Client) GetBestScoreByTimes ¶ added in v0.4.4
func (*Client) GetContest ¶
func (*Client) GetContestPodiums ¶
func (*Client) GetContestRecord ¶
func (c *Client) GetContestRecord(contestId uint) []RecordMessage
func (*Client) GetContestScore ¶
func (c *Client) GetContestScore(contestId uint) map[model.Project][]RoutesScores
func (*Client) GetContestSor ¶
func (c *Client) GetContestSor(contestId uint) (single, avg map[model.SorStatisticsKey][]SorScore)
func (*Client) GetContests ¶
func (*Client) GetPlayerBestScore ¶
func (*Client) GetPlayerNemesis ¶ added in v0.1.18
func (c *Client) GetPlayerNemesis(playerID uint) NemesisDetails
func (*Client) GetPlayerPodiums ¶
func (*Client) GetPlayerRecord ¶
func (c *Client) GetPlayerRecord(playerId uint) []RecordMessage
func (*Client) GetPlayerRelativeSor ¶ added in v0.1.14
func (c *Client) GetPlayerRelativeSor(playerID uint) map[model.SorStatisticsKey]RelativeSor
func (*Client) GetPlayerScore ¶
func (c *Client) GetPlayerScore(playerId uint) (bestSingle, bestAvg []model.Score, scores []ScoresByContest)
func (*Client) GetPlayerSor ¶
func (c *Client) GetPlayerSor(playerId uint) (single, avg map[model.SorStatisticsKey]SorScore)
func (*Client) GetPlayerUser ¶ added in v0.1.24
func (c *Client) GetPlayerUser(player model.Player) model.PlayerUser
func (*Client) GetPlayers ¶
func (*Client) GetPodiums ¶
func (*Client) GetPreScores ¶ added in v0.1.9
func (*Client) GetPreScoresByContest ¶ added in v0.1.9
func (*Client) GetPreScoresByPlayer ¶ added in v0.1.12
func (*Client) GetRecords ¶
func (*Client) GetRelativeSor ¶ added in v0.1.6
func (c *Client) GetRelativeSor() (allPlayerSor map[model.SorStatisticsKey][]RelativeSor)
func (*Client) GetScoreByPlayerContest ¶
func (*Client) GetSor ¶
func (c *Client) GetSor() (single, avg map[model.SorStatisticsKey][]SorScore)
func (*Client) ProcessPreScore ¶ added in v0.1.9
func (c *Client) ProcessPreScore(request ProcessPreScoreRequest) error
func (*Client) ReSetRecords ¶ added in v0.6.0
func (*Client) RemoveContest ¶
func (*Client) RemovePlayer ¶
func (*Client) RemoveScore ¶
func (*Client) UpdatePlayer ¶
func (*Client) UpdatePlayerUser ¶ added in v0.1.24
type ContestCore ¶
type ContestCore interface { AddContest(AddContestRequest) error // 添加比赛 RemoveContest(contestId uint) error // 删除比赛 GetAllContestStatics() (contests []ContestStatics) // 所有比赛的数据统计 GetContest(contestId uint) (contest model.Contest, err error) // 获取信息 GetContests(page, size int, typ string) (int64, []model.Contest, error) // 获取比赛列表 (分页) GetContestSor(contestID uint) (single, avg map[model.SorStatisticsKey][]SorScore) // 获取比赛sor排名 GetContestScore(contestID uint) map[model.Project][]RoutesScores // 获取比赛成绩列表 GetContestPodiums(contestID uint) []Podiums // 获取比赛领奖台 GetContestRecord(contestID uint) []RecordMessage // 获取比赛记录列表 }
type ContestStatics ¶ added in v0.2.1
type Core ¶
type Core interface { BackToFile() error ReSetRecords() error ScoreCore PlayerCore PlayerUserCore ContestCore StatisticalCore }
type NemesisDetail ¶ added in v0.1.18
type NemesisDetails ¶ added in v0.1.18
type NemesisDetails []NemesisDetail
type PlayerCore ¶
type PlayerCore interface { AddPlayer(player model.Player) error // 添加玩家 UpdatePlayer(playerId uint, player model.Player) error // 更新玩家信息 RemovePlayer(playerId uint) error // 删除玩家 GetPlayer(playerId uint) (PlayerDetail, error) // 获取玩家详细信息 GetPlayers(page, size int) (int64, []model.Player, error) // 获取玩家列表 (分页) GetPlayerBestScore(playerId uint) (bestSingle, bestAvg map[model.Project]RankScore) // 获取玩家 GetPlayerPodiums(playerID uint) Podiums // 获取玩家领奖台 GetPlayerRecord(playerID uint) []RecordMessage // 获取玩家记录 GetPlayerScore(playerID uint) (bestSingle, bestAvg []model.Score, scores []ScoresByContest) // 获取玩家所有成绩 GetPlayerSor(playerID uint) (single, avg map[model.SorStatisticsKey]SorScore) // 获取玩家sor信息 GetPlayerNemesis(playerID uint) NemesisDetails // 获取玩家宿敌信息 GetPlayerRelativeSor(playerID uint) map[model.SorStatisticsKey]RelativeSor // 获取单个玩家的相对排位分 }
type PlayerDetail ¶
type PlayerUserCore ¶ added in v0.1.24
type PlayerUserCore interface { GetPlayerUser(player model.Player) model.PlayerUser // 获取一个玩家的用户信息 AddPlayerUser(player model.Player, user model.PlayerUser) error // 添加一个用户信息 UpdatePlayerUser(player model.Player, user model.PlayerUser) error // 更新一个用户信息 }
type Podiums ¶
type PodiumsResult ¶
type ProcessPreScoreRequest ¶ added in v0.1.9
type ProjectPlayer ¶ added in v0.3.0
type RecordMessage ¶
type RelativeSor ¶ added in v0.1.6
type RoutesScores ¶
type ScoreCore ¶
type ScoreCore interface { AddScore(AddScoreRequest) error // 添加一条成绩 RemoveScore(scoreID uint) error // 移除一条成绩 EndContestScore(contestId uint) error // 结束比赛并统计比赛结果 GetScoreByPlayerContest(playerId uint, contestId uint) ([]model.Score, error) // 获取玩家在某场比赛的成绩 AddPreScore(AddPreScoreRequest) error // 添加一个预录入的成绩 ProcessPreScore(ProcessPreScoreRequest) error // 处理一个预录入的成绩 GetPreScores(page, size int, final Bool) (int64, []model.PreScore, error) // 获取预录入的成绩列表(分页), useFinal表示是否使用final筛选字段 GetPreScoresByPlayer(playerID uint, page, size int, final Bool) (int64, []model.PreScore, error) // 按玩家获取(分页) GetPreScoresByContest(contestID uint, page, size int, final Bool) (int64, []model.PreScore, error) // 按比赛获取(分页) }
type ScoresByContest ¶
type SorScore ¶
type SorScore struct { Player model.Player `json:"Player,omitempty"` SingleRank int64 `json:"SingleRank,omitempty"` SingleCount int64 `json:"SingleCount,omitempty"` SingleProjects int64 `json:"SingleProjects,omitempty"` // 参与项目数 AvgRank int64 `json:"AvgRank,omitempty"` AvgCount int64 `json:"AvgCount,omitempty"` AvgProjects int64 `json:"AvgProjects,omitempty"` // 参与项目数 }
type StatisticalCore ¶
type StatisticalCore interface { GetRecords(page, size int) (int64, []model.Record, error) // 获取所有记录(分页) GetBestScore() (bestSingle, bestAvg map[model.Project][]model.Score) // 获取所有项目每个人的最佳成绩汇总 GetBestScoreByTimes(startTime, endTime time.Time) (bestSingle, bestAvg map[model.Project][]model.Score) // [Time]获取所有项目每个人的最佳成绩汇总 GetBestScoreByProject(project model.Project) (bestSingle, bestAvg []model.Score) // 获取单项目每个人最佳成绩汇总成绩 GetAllProjectBestScores() (bestSingle, bestAvg map[model.Project]model.Score) // 获取所有项目最佳成绩 GetAllProjectBestScoresByTimes(startTime, endTime time.Time) (bestSingle, bestAvg map[model.Project]model.Score) // [Time]获取所有项目最佳成绩 GetPodiums() []Podiums // 获取领奖台汇总 GetSor() (single, avg map[model.SorStatisticsKey][]SorScore) // 获取sor排名汇总 GetAvgRelativeSor() map[model.SorStatisticsKey]RelativeSor // 平均相对排位分 GetRelativeSor() (allPlayerSor map[model.SorStatisticsKey][]RelativeSor) // 相对排位分, 返回所有人的平均排位分,计算方式是用当前最佳成绩为标准, 计算与其差距 }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.