Documentation ¶
Index ¶
- Constants
- func SortResultsAndUpdateRank(rt RouteType, in []Results)
- func SortResultsByAvg(in []Results)
- func SortResultsByBest(in []Results)
- type Event
- type EventI18N
- type EventName
- type Penalty
- type PreResults
- type Record
- type Results
- func (c *Results) AfterFind(*gorm.DB) error
- func (c *Results) BeforeCreate(*gorm.DB) error
- func (c *Results) BeforeSave(*gorm.DB) error
- func (c *Results) BeforeUpdate(*gorm.DB) error
- func (c *Results) D() bool
- func (c *Results) DAvg() bool
- func (c *Results) DBest() bool
- func (c *Results) IsBest(other Results) bool
- func (c *Results) IsBestAvg(other Results) bool
- func (c *Results) Update() error
- type RouteType
Constants ¶
View Source
const ( DNF = -10000 - iota DNS )
Variables ¶
This section is empty.
Functions ¶
func SortResultsByAvg ¶
func SortResultsByAvg(in []Results)
Types ¶
type Event ¶
type Event struct { basemodel.StringIDModel EventI18NJSON string `gorm:"column:events"` EventI18N []EventI18N `gorm:"-"` IsComp bool `gorm:"column:is_comp"` // 比赛项目 Icon string `gorm:"column:icon"` // Icon IconBase64 string `gorm:"column:icon_base64"` // Icon base64 IsWCA bool `gorm:"column:is_wca"` // WCA项目 RouteType RouteType `gorm:"column:route_typ"` // 轮次 }
type PreResults ¶
type PreResults struct { Results CompsName string `gorm:"column:comps_name"` // 比赛名 RoundName string `gorm:"column:round_name"` // 轮次名 Recorder string `gorm:"column:recorder"` // 记录人 Processor string `gorm:"column:processor"` // 处理人ID Finish bool `gorm:"column:finish"` // 是否处理 FinishDetail string `gorm:"column:finish_detail"` // 处理结果 Source string `gorm:"column:source"` // 来源 }
type Record ¶
type Record struct { basemodel.Model EventId string `gorm:"column:event_id"` // 项目ID EventRoute RouteType `gorm:"column:route_type"` // 项目类型 ResultId string `gorm:"column:result_id"` // 成绩ID UserId uint `gorm:"column:user_id"` // 用户ID UserName string `gorm:"column:user_name"` // 用户名 CompsId string `gorm:"column:comps_id"` // 比赛ID CompsGenre compertion.Genre `gorm:"column:comps_genre"` // 比赛类型 Best *float64 `gorm:"column:best"` // 最佳成绩 Average *float64 `gorm:"column:average"` // 平均成绩 Repeatedly *string `gorm:"column:repeatedly"` // 多次尝试成绩 }
type Results ¶
type Results struct { basemodel.Model CompetitionID string `gorm:"column:comp_id"` // 比赛ID EventID string `gorm:"column:event_id"` // 项目 EventRoute RouteType `gorm:"column:route_type"` // 项目类型 Route uint `gorm:"column:route"` // 轮次 PersonName string `gorm:"column:person_name"` // 玩家名 UserID uint `gorm:"column:user_id"` // ID Best float64 `gorm:"column:best"` // 最佳成绩 BestRepeatedly float64 `gorm:"column:best_repeatedly"` // 多次尝试的成绩 Average float64 `gorm:"column:average"` // 平均成绩 ResultJSON string `gorm:"column:result_json"` // 成绩列表JSON Result []float64 `gorm:"-"` // 成绩数据 PenaltyJSON string `gorm:"column:penalty_json"` // 判罚 Penalty Penalty `gorm:"-"` // 判罚列表 }
type RouteType ¶
type RouteType int
const ( RouteTypeNot RouteType = iota // 非比赛项目 RouteType1rounds // "1_r" // 单轮项目 RouteType3roundsBest // "3_r_b" // 三轮取最佳 RouteType3roundsAvg // "3_r_a" // 三轮取平均 RouteType5roundsBest // "5_r_b" // 五轮取最佳 RouteType5roundsAvg // "5_r_a" // 五轮取平均 RouteType5RoundsAvgHT // "5_r_a_ht" // 五轮去头尾取平均 RouteTypeRepeatedly // "ry" // 单轮多次还原项目, 成绩1:还原数; 成绩2:尝试数; 成绩3:时间; RouteType3RepeatedlyBest // "3ry" // 三轮尝试多次还原项目 成绩1:还原数; 成绩2:尝试数; 成绩3:时间; 循环3次 )
Click to show internal directories.
Click to hide internal directories.