compertion

package
v0.0.0-...-d48d45f Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssCompetitionUsers

type AssCompetitionUsers struct {
	basemodel.Model

	CompId       uint `gorm:"index:,unique,composite:AssCompetitionUsers"`
	SponsorsId   uint `gorm:"index:,unique,composite:AssCompetitionUsers"`
	RepresentsId uint `gorm:"index:,unique,composite:AssCompetitionUsers"`
}

type Competition

type Competition struct {
	basemodel.Model // 这里的ID需要符合条件

	StrId string `gorm:"column:str_id,uniqueIndex"`

	// 详情
	InformationJSON string                   `gorm:"column:info,type:string"` // 说明 []CompetitionInformation JSON
	Information     []CompetitionInformation `gorm:"-"`                       // I18N

	// 基础限制
	Genre           Genre `gorm:"column:genre,type:string,not null"` // 比赛形式
	MinCount        uint  `gorm:"column:min_count"`                  // 最低开赛限制
	Count           uint  `gorm:"column:count"`                      // 人数
	FreeParticipate bool  `gorm:"free_p"`                            // 自由参赛, 支持非正式赛

	// 时间相关
	CompStartTime                  time.Time `gorm:"column:comp_start_time"`    // 比赛开始时间
	CompEndTime                    time.Time `gorm:"column:comp_end_time"`      // 比赛结束时间
	RegistrationStartTime          time.Time `gorm:"column:reg_start_time"`     // 报名开始时间
	RegistrationEndTime            time.Time `gorm:"column:reg_end_time"`       // 报名结束时间
	RegistrationCancelDeadlineTime time.Time `gorm:"column:reg_cancel_dl_time"` // 退赛截止时间
	RegistrationRestartTime        time.Time `gorm:"column:reg_restart_time"`   // 报名重开时间

	// 主办
	SponsorGroupID uint `gorm:"column:sponsor_group_id"` // 主办团队
	// WCA相关
	WCAUrl string `gorm:"column:wca_url"` // WCA 认证地址
}

func (*Competition) AfterFind

func (c *Competition) AfterFind(tx *gorm.DB) (err error)

type CompetitionDiscussion

type CompetitionDiscussion struct {
	basemodel.Model
}

type CompetitionEvent

type CompetitionEvent struct {
	EventName     string                // 项目名称
	SingleQualify float64               // 单次资格线
	AvgQualify    float64               // 平均资格线
	HasResults    float64               // 有成绩
	Schedule      []CompetitionSchedule // 赛程
}

type CompetitionInformation

type CompetitionInformation struct {
	Language     i18n.Language      // 语言
	Name         string             // 名称
	Illustrate   string             // 详细说明
	Location     string             // 地址
	LocationAddr []float64          // 经纬坐标
	Country      string             // 地区
	City         string             // 城市
	RuleMD       string             // 规则
	Events       []CompetitionEvent // 项目列表
	Series       []string           // 系列赛
}

type CompetitionRegistration

type CompetitionRegistration 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"`

	RegistrationTime time.Time  `gorm:"column:reg_time"`    // 报名时间
	AcceptationTime  *time.Time `gorm:"column:acc_time"`    // 通过时间
	RetireTime       *time.Time `gorm:"column:retire_time"` // 退赛时间

	Payments     []Payment `gorm:"-"`               // 报名费 + 追加的项目报名费
	PaymentsJSON string    `gorm:"column:payments"` // []Event JSON
}

type CompetitionSchedule

type CompetitionSchedule struct {
	Stage          string        // 赛台
	Event          string        // 项目
	StartTime      time.Time     // 开始时间
	EndTime        time.Time     // 结束时间
	Round          string        // 轮次
	Format         string        // 赛制
	Cutoff         time.Duration // 及格线
	TimeLimit      time.Duration // 还原时限
	MinCompetitors int           // 最低限制人数
	Competitors    int           // 人数
}

type Genre

type Genre uint
const (
	WCA            Genre = iota + 1 // WCA认证比赛
	Official                        // 线下正式比赛
	OnlineOfficial                  // 线上正式比赛
	Informal                        // 线下非正式比赛
	OnlineInformal                  // 线上非正式比赛
)

type PayType

type PayType = uint
const (
	PayTypeTest   PayType = iota + 1 // 测试接口
	PayTypeWeChat                    // 微信
	PayTypeAliPay                    // 支付宝
	PayTypeCash                      // 现金
	PayTypeOther                     // 其他
)

type Payment

type Payment struct {
	Events []result.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"` // 实际退费金额
}

Jump to

Keyboard shortcuts

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