Files
bl/modules/blazing/model/challenge.go
昔念 3298bad0f2 refactor(blazing): 重构登录模块并移除示例代码
- 重构了登录控制器和登录服务,使用了cool框架的控制器和服务结构
- 移除了注册相关代码和不必要的示例代码
- 更新了登录服务,关联了服务器列表模型
- 删除了与示例相关的模型和服务文件
2025-06-28 16:16:28 +08:00

43 lines
1.5 KiB
Go

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{})
}