Files
bl/common/cool/model.go
昔念 75e428f62e refactor(blazing): 重构任务系统并优化相关功能
- 重构了任务系统的数据结构和执行逻辑
- 优化了地图加载和怪物刷新机制
- 改进了宠物系统的基础架构
- 调整了玩家信息和背包的处理方式
- 统一了数据访问层的接口和实现
2025-08-30 21:59:52 +08:00

43 lines
954 B
Go

package cool
import (
"time"
)
type IModel interface {
TableName() string
GroupName() string
}
type UserModel interface {
GetData() string
SetData(data string)
TableName() string
GroupName() string
}
type Model struct {
ID uint `gorm:"primaryKey" json:"id"`
CreateTime time.Time `gorm:"column:createTime;not null;index,priority:1;autoCreateTime:nano;comment:创建时间" json:"createTime"` // 创建时间
UpdateTime time.Time `gorm:"column:updateTime;not null;index,priority:1;autoUpdateTime:nano;comment:更新时间" json:"updateTime"` // 更新时间
DeletedAt time.Time `gorm:"index" json:"deletedAt"`
}
// 返回表名
func (m *Model) TableName() string {
return "this_table_should_not_exist"
}
// 返回分组名
func (m *Model) GroupName() string {
return "default"
}
func NewModel() *Model {
return &Model{
ID: 0,
CreateTime: time.Time{},
UpdateTime: time.Time{},
DeletedAt: time.Time{},
}
}