package model import ( "blazing/cool" ) // todo 还需要做一个记录任务奖励的表 const TableNameTask = "player_task" // Task mapped from table type Task struct { Base PlayerID uint64 `gorm:"not null;index:idx_task_by_player_id;comment:'所属玩家ID'" json:"player_id"` TaskID uint32 `gorm:"not null;comment:'任务ID'" json:"task_id"` Data []uint32 `struc:"[20]byte" gorm:"type:jsonb;not null;default:'[]';comment:'全部数据'" json:"data"` } // TaskEX 单个任务的详细信息,包含任务步骤状态和整体状态 // TableName PlayerInfo's table name func (*Task) TableName() string { return TableNameTask } // GroupName PlayerInfo's table group func (*Task) GroupName() string { return "default" } // NewPlayerInfo create a new PlayerInfo func NewTask() *Task { return &Task{ Base: *NewBase(), } } // init 创建表 func init() { cool.CreateTable(&Task{}) }