Files
bl/modules/blazing/model/challenge.go

43 lines
1.5 KiB
Go
Raw Normal View History

package model
import (
"blazing/cool"
)
const TableNameChallenge = "challenge"
// Challenge mapped from table <challenge>
type Challenge struct {
*cool.Model
PlayerID uint64 `gorm:"not null;uniqueIndex:idx_challenge_unique_by_player_id;comment:'所属玩家ID'" json:"player_id"`
MonKingWin int32 `gorm:"not null;default:0;comment:'精灵王之战胜场数'" json:"mon_king_win"`
CurStage int16 `gorm:"not null;default:0;comment:'当期勇者之塔到达的层数'" json:"cur_stage"`
MaxStage int16 `gorm:"not null;default:0;comment:'历史勇者之塔到达的最大层数'" json:"max_stage"`
MessWin int32 `gorm:"not null;default:0;comment:'精灵大乱斗胜场数'" json:"mess_win"`
CurFreshStage int16 `gorm:"not null;default:0;comment:'试炼之塔当前层数'" json:"cur_fresh_stage"`
MaxFreshStage int16 `gorm:"not null;default:0;comment:'试炼之塔当前层数'" json:"max_fresh_stage"`
MaxArenaWins int32 `gorm:"not null;default:0;comment:'最大星际擂台连胜数'" json:"max_arena_wins"`
}
// TableName Challenge's table name
func (*Challenge) TableName() string {
return TableNameChallenge
}
// GroupName Challenge's table group
func (*Challenge) GroupName() string {
return "default"
}
// NewChallenge create a new Challenge
func NewChallenge() *Challenge {
return &Challenge{
Model: cool.NewModel(),
}
}
// init 创建表
func init() {
cool.CreateTable(&Challenge{})
}