feat(config): 重构配置结构并添加服务器列表支持 - 重命名PortBL字段为GameOnlineID,改进命名语义 - 添加ServerList结构体用于管理服务器配置 - 移除七牛云配置相关字段 - 更新ID生成器使用GameOnlineID参数 fix(server): 调整服务器启动参数和VIP逻辑 - 将启动参数从-port改为-id,统一参数命名 - 更新服务器启动逻辑,基于GameOnlineID获取服务器信息 - 为VIP服务器启用调试模式 - 优化端口可用性检查逻辑 refactor(model): 统一模型基类结构 - 将各模型中的*cool.Model嵌入改为Base基类 - 移除soul.go
56 lines
1.4 KiB
Go
56 lines
1.4 KiB
Go
package model
|
||
|
||
import (
|
||
"blazing/cool"
|
||
)
|
||
|
||
// todo 还需要做一个记录任务奖励的表
|
||
const TableNameTask = "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"`
|
||
}
|
||
|
||
// 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 {
|
||
return TableNameTask
|
||
}
|
||
|
||
// GroupName PlayerInfo's table group
|
||
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{
|
||
Base: *NewBase(),
|
||
}
|
||
}
|
||
|
||
// init 创建表
|
||
func init() {
|
||
cool.CreateTable(&Task{})
|
||
}
|