Documentation ¶
Index ¶
- type AssCompetitionSponsorsUsers
- type CompertionGroup
- type Competition
- func (c *Competition) AfterFind(tx *gorm.DB) (err error)
- func (c *Competition) BeforeCreate(*gorm.DB) error
- func (c *Competition) BeforeSave(*gorm.DB) error
- func (c *Competition) BeforeUpdate(*gorm.DB) error
- func (c *Competition) CheckRegisterTime() error
- func (c *Competition) EventMap() map[string]CompetitionEvent
- func (c *Competition) IsRunningTime() bool
- func (c *Competition) StatusName() string
- func (c *Competition) UpdateEvent(ev CompetitionEvent)
- type CompetitionCost
- type CompetitionDiscussion
- type CompetitionEvent
- type CompetitionJson
- type CompetitionStatus
- type Cost
- type Genre
- type PayType
- type Payment
- type RegisterStatus
- type Registration
- type Schedule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompertionGroup ¶
type Competition ¶
type Competition struct { basemodel.Model // 这里的ID需要符合条件 StrId string `gorm:"column:str_id;null" json:"StrId,omitempty"` Status CompetitionStatus `gorm:"column:status" json:"Status,omitempty"` RejectMsg string `gorm:"column:reject_msg;null" json:"RejectMsg,omitempty"` // 详情 Name string `gorm:"column:name" json:"Name,omitempty"` // 名称 Illustrate string `gorm:"column:illustrate;null" json:"Illustrate,omitempty"` // 详细说明 MD Location string `gorm:"column:location;null" json:"Location,omitempty"` // 地址 LocationAddr string `gorm:"column:location_addr;null" json:"LocationAddr,omitempty"` // 经纬坐标 Country string `gorm:"column:country;null" json:"Country,omitempty"` // 地区 City string `gorm:"column:city;null" json:"City,omitempty"` // 城市 RuleMD string `gorm:"column:rule_md;null" json:"RuleMD,omitempty"` // 规则 CompJSONStr string `gorm:"column:comp_json;null" json:"-"` // 项目列表JSON CompJSON CompetitionJson `gorm:"-" json:"comp_json,omitempty"` // 项目列表 EventMin string `gorm:"column:event_min;null" json:"EventMin,omitempty"` // 项目列表简列 ;隔开 Series string `gorm:"column:series;null" json:"Series,omitempty"` // 系列赛 Logo string `gorm:"column:logo;null" json:"logo,omitempty"` // logo IsDone bool `gorm:"column:is_done"` // 是否已经结束比赛 // 基础限制 Genre Genre `gorm:"column:genre;not null" json:"Genre,omitempty"` // 比赛形式 MinCount int64 `gorm:"column:min_count;null" json:"MinCount,omitempty"` // 最低开赛限制 Count int64 `gorm:"column:count;null" json:"Count,omitempty"` // 最大人数 FreeParticipate bool `gorm:"column:free_p;null" json:"FreeParticipate,omitempty"` // 自由参赛, 仅支持非正式赛 AutomaticReview bool `gorm:"column:auto_review;null" json:"AutomaticReview,omitempty"` // 自动审核 CanPreResult bool `gorm:"column:can_pre_result;null" json:"CanPreResult,omitempty"` // 允许提交预录入成绩 CanStartedAddEvent bool `gorm:"column:can_started_add_event;null" json:"CanStartedAddEvent,omitempty"` // 开赛后是否可追加项目(第一轮结束后不可追加) // 时间相关 CompStartTime time.Time `gorm:"column:comp_start_time" json:"CompStartTime,omitempty"` // 比赛开始时间 CompEndTime time.Time `gorm:"column:comp_end_time" json:"CompEndTime,omitempty"` // 比赛结束时间 RegistrationStartTime *time.Time `gorm:"column:reg_start_time;null" json:"RegistrationStartTime,omitempty"` // 报名开始时间 RegistrationEndTime *time.Time `gorm:"column:reg_end_time;null" json:"RegistrationEndTime,omitempty"` // 报名结束时间 RegistrationCancelDeadlineTime *time.Time `gorm:"column:reg_cancel_dl_time;null" json:"RegistrationCancelDeadlineTime,omitempty"` // 退赛截止时间 IsRegisterRestart bool `gorm:"column:is_register_restart;null" json:"IsRegisterRestart,omitempty"` RegistrationRestartTime *time.Time `gorm:"column:reg_restart_time;null" json:"RegistrationRestartTime,omitempty"` // 报名重开时间 // 主办 OrganizersID uint `gorm:"column:orgId;null" json:"OrganizersID,omitempty"` // 主办团队 GroupID uint `gorm:"column:group_id;null" json:"GroupId,omitempty"` // 群ID // WCA相关 WCAUrl string `gorm:"column:wca_url;null" json:"WCAUrl,omitempty"` // WCA 认证地址 }
func (*Competition) BeforeCreate ¶
func (c *Competition) BeforeCreate(*gorm.DB) error
func (*Competition) BeforeSave ¶
func (c *Competition) BeforeSave(*gorm.DB) error
func (*Competition) BeforeUpdate ¶
func (c *Competition) BeforeUpdate(*gorm.DB) error
func (*Competition) CheckRegisterTime ¶
func (c *Competition) CheckRegisterTime() error
func (*Competition) EventMap ¶
func (c *Competition) EventMap() map[string]CompetitionEvent
func (*Competition) IsRunningTime ¶
func (c *Competition) IsRunningTime() bool
IsRunningTime 是否在比赛时间段内
func (*Competition) StatusName ¶
func (c *Competition) StatusName() string
func (*Competition) UpdateEvent ¶
func (c *Competition) UpdateEvent(ev CompetitionEvent)
type CompetitionCost ¶
type CompetitionCost struct { BaseCost Cost `json:"BaseCost,omitempty"` Costs []Cost `json:"Costs,omitempty"` // 分阶段的报名费 EventCost map[string]CompetitionCost `json:"EventCost,omitempty"` // 项目的cost }
type CompetitionDiscussion ¶
type CompetitionEvent ¶
type CompetitionEvent struct { EventName string `json:"EventName,omitempty"` // 项目名称 EventID string `json:"EventID,omitempty"` // 项目所指ID EventRoute event.RouteType `json:"EventRoute,omitempty"` // 项目类型 IsComp bool `json:"IsComp,omitempty"` // 是否比赛项目 // 资格线 SingleQualify float64 `json:"SingleQualify,omitempty"` // 单次资格线 AvgQualify float64 `json:"AvgQualify,omitempty"` // 平均资格线 HasResultsQualify bool `json:"HasResultsQualify,omitempty"` // 有成绩 // 赛程 Schedule []Schedule `json:"Schedule,omitempty"` // 赛程 Done bool `json:"Done,omitempty"` // 是否已结束 }
func (*CompetitionEvent) CurRunningSchedule ¶
func (c *CompetitionEvent) CurRunningSchedule(round interface{}, run *bool) (Schedule, error)
func (*CompetitionEvent) UpdateSchedule ¶
func (c *CompetitionEvent) UpdateSchedule(round interface{}, schedule Schedule)
type CompetitionJson ¶
type CompetitionJson struct { Events []CompetitionEvent `json:"Events,omitempty"` Cost CompetitionCost `json:"Cost,omitempty"` }
type CompetitionStatus ¶
type CompetitionStatus = string
const ( Reviewing CompetitionStatus = "Reviewing" Running CompetitionStatus = "Running" Reject CompetitionStatus = "Reject" Temporary CompetitionStatus = "Temporary" )
type Payment ¶
type Payment struct { Events []event.Event `json:"events"` // 报名项目 PayType PayType `json:"payType"` // 支付类型 Remark string `json:"remark"` // 备注 // 支付相关 CreateTime time.Time `json:"createTime"` // 创建时间 OrderNumber string `json:"orderNumber"` // 订单号 BaseResult float64 `json:"baseResult"` // 基础报名费 EventResults []float64 `json:"eventResults"` // 需要支付金额, 按每个项目来算 ActualResult float64 `json:"actualResult"` // 实际支付金额, 按所有基础报名费 + 项目 // 退费相关 RefundTime *time.Time `json:"refundTime"` // 退费时间 RefundRatio float64 `json:"refundRatio"` // 退费比例 RefundOrderNumber string `json:"refundOrderNumber"` // 退费订单号 RefundResult float64 `json:"refundResult"` // 需要退费金额 ActualRefundResult float64 `json:"actualRefundResult"` // 实际退费金额 }
type RegisterStatus ¶
type RegisterStatus = string
const ( RegisterStatusPass RegisterStatus = "pass" RegisterStatusQueue RegisterStatus = "queue" RegisterStatusWaitPayment RegisterStatus = "wait_payment" RegisterStatusWaitApply RegisterStatus = "wait_apply" RegisterStatusNotApply RegisterStatus = "not_apply" )
type Registration ¶
type Registration struct { basemodel.Model CompID uint `gorm:"column:comp_id"` // 比赛ID CompName string `gorm:"column:comp_name"` UserID uint `gorm:"column:user_id"` // 选手ID UserName string `gorm:"column:user_name"` Status RegisterStatus `gorm:"column:status"` // 注册状态 RegistrationTime time.Time `gorm:"column:reg_time"` // 报名时间 AcceptationTime *time.Time `gorm:"column:acc_time"` // 通过时间 RetireTime *time.Time `gorm:"column:retire_time"` // 退赛时间 Events string `gorm:"column:events"` // 选择的项目ID列表 Payments []Payment `gorm:"-"` // 报名费 + 追加的项目报名费 PaymentsJSON string `gorm:"column:payments" json:"-"` // []Event JSON }
func (Registration) EventsList ¶
func (c Registration) EventsList() []string
type Schedule ¶
type Schedule struct { Round string `json:"Round,omitempty"` // 轮次 Stage string `json:"Stage,omitempty"` // 赛台 Event string `json:"Event,omitempty"` // 项目 IsComp bool `json:"IsComp,omitempty"` // 是否比赛项目 StartTime time.Time `json:"StartTime,omitempty"` // 开始时间 EndTime time.Time `json:"EndTime,omitempty"` // 结束时间 Format string `json:"Format,omitempty"` // 赛制 Competitors int `json:"Competitors,omitempty"` // 人数 ActualStartTime time.Time `json:"ActualStartTime,omitempty"` // 实际开始时间 ActualEndTime time.Time `json:"ActualEndTime,omitempty"` // 实际结束时间 NoRestrictions bool `json:"NoRestrictions"` // 无限制 Cutoff float64 `json:"Cutoff,omitempty"` // 及格线 CutoffNumber int `json:"CutoffNumber,omitempty"` // 及格线把数 TimeLimit float64 `json:"TimeLimit,omitempty"` // 还原时限 RoundNum int `json:"RoundNum,omitempty"` // 轮次数字排序 IsRunning bool `json:"IsRunning,omitempty"` // 是否正在执行的轮次 FirstRound bool `json:"FirstRound,omitempty"` // 第一轮 FinalRound bool `json:"FinalRound,omitempty"` // 最后一轮 AdvancedToThisRound []uint `json:"AdvancedToNextRound,omitempty"` // 本轮晋级的选手 }
Click to show internal directories.
Click to hide internal directories.