result

package
v0.0.0-...-31439ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DetailOk       = "ok"
	DetailNot      = "not"
	DetailWait     = "wait"
	DetailDoubtful = "doubtful"
	DetailTimeout  = "timeout" // 过期
)
View Source
const (
	RecordTypeWithCubingPro = "CR" // 全网站R
	RecordTypeWithGroup     = "GR" // 群R
)
View Source
const (
	DNF = -10000 - iota // 未还原
	DNS                 // 未开始
	DNP                 // 未晋级
	DNT                 // 超时
)

Variables

This section is empty.

Functions

func SortResult

func SortResult(in []Results)

func SortResultWithAvg

func SortResultWithAvg(in []Results)

func SortResultWithBest

func SortResultWithBest(in []Results)

func TimeParser

func TimeParser(in float64) string

func UpdateOrgResult

func UpdateOrgResult(
	in []float64, eventRoute event.RouteType,
	cutoff float64, cutoffNumber int,
	timeLimit float64,
) []float64

Types

type Penalty

type Penalty [][]float64

type PreResults

type PreResults struct {
	Results

	ResultID     *uint  `gorm:"column:result_id"`     // 对应的ID
	CompsName    string `gorm:"column:comps_name"`    // 比赛名
	RoundName    string `gorm:"column:round_name"`    // 轮次名
	Recorder     string `gorm:"column:recorder"`      // 记录人
	Processor    string `gorm:"column:processor"`     // 处理人
	ProcessorID  uint   `gorm:"column:processor_id"`  // 处理人ID
	Finish       bool   `gorm:"column:finish"`        // 是否处理
	Detail       string `gorm:"column:detail"`        // 处理结果
	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  event.RouteType   `gorm:"column:route_type"`   // 项目类型
	Type        string            `gorm:"column:d_type"`       // 记录类型
	ResultId    uint              `gorm:"column:result_id"`    // 成绩ID
	UserId      uint              `gorm:"column:user_id"`      // 用户ID
	CubeId      string            `gorm:"column:cube_id"`      // cube id
	UserName    string            `gorm:"column:user_name"`    // 用户名
	CompsId     uint              `gorm:"column:comps_id"`     // 比赛ID
	CompsName   string            `gorm:"column:comps_name"`   // 比赛名
	CompsGenre  competition.Genre `gorm:"column:comps_genre"`  // 比赛类型
	Best        *float64          `gorm:"column:best"`         // 最佳成绩
	Average     *float64          `gorm:"column:average"`      // 平均成绩
	Repeatedly  *string           `gorm:"column:repeatedly"`   // 多次尝试成绩
	ThisResults string            `gorm:"column:this_results"` // 本次成绩
	GroupId     uint              `gorm:"column:group_id"`     // 群ID
}

func (*Record) Key

func (r *Record) Key() string

type Results

type Results struct {
	basemodel.Model

	CompetitionID   uint    `gorm:"column:comp_id" json:"CompetitionID,omitempty"`     // 比赛ID
	CompetitionName string  `gorm:"column:comp_name" json:"CompetitionName,omitempty"` // 比赛名
	Round           string  `gorm:"column:round" json:"Round,omitempty"`               // 轮次名
	RoundNumber     int     `gorm:"column:round_number" json:"RoundNumber,omitempty"`  // 轮次号
	PersonName      string  `gorm:"column:person_name" json:"PersonName,omitempty"`    // 玩家名
	UserID          uint    `gorm:"column:user_id" json:"UserID,omitempty"`            // ID
	CubeID          string  `gorm:"column:cube_id" json:"CubeID,omitempty"`            // CubeID
	Best            float64 `gorm:"column:best" json:"Best,omitempty"`                 // 最佳成绩
	Average         float64 `gorm:"column:average" json:"Average,omitempty"`           // 平均成绩

	// 计次项目
	BestRepeatedlyReduction float64 `gorm:"column:best_repeatedly_reduction" json:"BestRepeatedlyReduction,omitempty"` // 计次最佳成绩成功
	BestRepeatedlyTry       float64 `gorm:"column:best_repeatedly_try" json:"BestRepeatedlyTry,omitempty"`             // 计次尝试
	BestRepeatedlyTime      float64 `gorm:"column:best_repeatedly" json:"BestRepeatedlyTime,omitempty"`                // 计次的成绩

	ResultJSON  string    `gorm:"column:result_json" json:"ResultJSON"`             // 成绩列表JSON
	Result      []float64 `gorm:"-" json:"Result,omitempty"`                        // 成绩数据
	PenaltyJSON string    `gorm:"column:penalty_json" json:"PenaltyJSON,omitempty"` // 判罚
	Penalty     Penalty   `gorm:"-" json:"Penalty,omitempty"`                       // 判罚列表

	EventID    string          `gorm:"column:event_id" json:"EventID,omitempty"`      // 项目
	EventName  string          `gorm:"column:event_name" json:"EventName,omitempty"`  // 项目名
	EventRoute event.RouteType `gorm:"column:route_type" json:"EventRoute,omitempty"` // 项目类型
	Ban        bool            `gorm:"column:ban" json:"Ban,omitempty"`               // 该成绩是否被ban

	Rank int `json:"Rank,omitempty" gorm:"-"` // 排名
}

func (*Results) AfterFind

func (c *Results) AfterFind(*gorm.DB) error

func (*Results) BeforeCreate

func (c *Results) BeforeCreate(*gorm.DB) error

func (*Results) BeforeSave

func (c *Results) BeforeSave(*gorm.DB) error

func (*Results) BeforeUpdate

func (c *Results) BeforeUpdate(*gorm.DB) error

func (*Results) BestAvgString

func (c *Results) BestAvgString() string

func (*Results) BestString

func (c *Results) BestString() string

func (*Results) D

func (c *Results) D() bool

func (*Results) DAvg

func (c *Results) DAvg() bool

func (*Results) DBest

func (c *Results) DBest() bool

func (*Results) EqualRepeatedly

func (c *Results) EqualRepeatedly(other Results) bool

func (*Results) IsBest

func (c *Results) IsBest(other Results) bool

func (*Results) IsBestAvg

func (c *Results) IsBestAvg(other Results) bool

func (*Results) Update

func (c *Results) Update() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL