refactor: 重构任务服务读写逻辑
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

This commit is contained in:
xinian
2026-04-09 22:59:28 +08:00
parent d0abb08d5b
commit b327398448
3 changed files with 65 additions and 38 deletions

View File

@@ -9,7 +9,7 @@ const TableNameTask = "player_task"
// Task mapped from table <task>
type Task struct {
Base
*cool.Model
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"`
@@ -30,7 +30,7 @@ func (*Task) GroupName() string {
// NewPlayerInfo create a new PlayerInfo
func NewTask() *Task {
return &Task{
Base: *NewBase(),
Model: cool.NewModel(),
}
}