This commit is contained in:
@@ -10,20 +10,12 @@ const TableNameTask = "player_task"
|
||||
// Task mapped from table <task>
|
||||
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 string `gorm:"type:jsonb;not null;comment:'全部数据'" json:"data"`
|
||||
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 单个任务的详细信息,包含任务步骤状态和整体状态
|
||||
type TaskEX struct {
|
||||
Task
|
||||
Data []uint32 `struc:"[20]byte" orm:"data" json:"data"`
|
||||
//LastResetTime time.Time `gorm:"not null;comment:'上次重置时间(UTC)'" json:"last_reset_time"` //这里是每天重置
|
||||
// Status 任务整体状态:0-未接受,1-已接受,2-已完成未领取,3-已完成已领取
|
||||
// json标签指定JSON字段名,与业务状态说明保持一致
|
||||
//Status byte `json:"status"`
|
||||
}
|
||||
|
||||
// TableName PlayerInfo's table name
|
||||
func (*Task) TableName() string {
|
||||
@@ -35,13 +27,6 @@ func (*Task) GroupName() string {
|
||||
return "default"
|
||||
}
|
||||
|
||||
func (t *Task) GetData() string {
|
||||
return t.Data
|
||||
}
|
||||
func (t *Task) SetData(t1 string) {
|
||||
t.Data = t1
|
||||
}
|
||||
|
||||
// NewPlayerInfo create a new PlayerInfo
|
||||
func NewTask() *Task {
|
||||
return &Task{
|
||||
|
||||
Reference in New Issue
Block a user