diff --git a/logic/server.go b/logic/server.go index c5bbf9173..b89bf2324 100644 --- a/logic/server.go +++ b/logic/server.go @@ -15,7 +15,6 @@ import ( "net" "github.com/gogf/gf/v2/frame/g" - "github.com/gogf/gf/v2/os/gcache" "github.com/gogf/gf/v2/util/gconv" ) @@ -58,9 +57,9 @@ func isPortAvailable(port uint32) bool { func Start() { serverID := cool.Config.GameOnlineID cool.Config.ServerInfo = config.NewServerService().GetServerID(serverID).ServerList - if cool.Config.ServerInfo.IsVip != 0 { - g.DB().GetCache().SetAdapter(gcache.NewAdapterRedis(cool.Redis)) //设置数据库 - } + // if cool.Config.ServerInfo.IsVip != 0 { + // g.DB().GetCache().SetAdapter(gcache.NewAdapterRedis(cool.Redis)) //设置数据库 + // } if cool.Config.ServerInfo.IsDebug == 1 { g.DB().SetDebug(true) diff --git a/modules/config/model/config_egg.go b/modules/config/model/config_egg.go index 0117a6145..1d63e0d2c 100644 --- a/modules/config/model/config_egg.go +++ b/modules/config/model/config_egg.go @@ -2,8 +2,6 @@ package model import ( "blazing/cool" - - "github.com/gogf/gf/v2/os/gtime" ) const ( @@ -11,12 +9,9 @@ const ( ) type BaseConfig struct { - ID uint `gorm:"primaryKey" json:"id"` - CreateTime *gtime.Time ` gorm:"column:createTime;not null;index,priority:1;autoCreateTime:nano;comment:创建时间" json:"createTime"` // 创建时间 - UpdateTime *gtime.Time `orm:"autoUpdateTime=true" gorm:"column:updateTime;not null;index,priority:1;autoUpdateTime:nano;comment:更新时间" json:"updateTime"` // 更新时间 - DeletedAt *gtime.Time `gorm:"index" json:"deletedAt"` - IsEnable int32 `gorm:"not null;default:0;comment:'是否启用(1:启用,0:禁用)'" json:"is_enable"` // 保留原有逻辑 - Remark string `gorm:"type:varchar(255);default:'';comment:'性别配置备注(如:默认性别规则)'" json:"remark"` // 调整注释 + *cool.Model // 保留通用Model(ID/创建时间/更新时间等) + IsEnable int32 `gorm:"not null;default:0;comment:'是否启用(1:启用,0:禁用)'" json:"is_enable"` // 保留原有逻辑 + Remark string `gorm:"type:varchar(255);default:'';comment:'性别配置备注(如:默认性别规则)'" json:"remark"` // 调整注释 } func (m *BaseConfig) TableName() string { @@ -29,7 +24,9 @@ func (m *BaseConfig) GroupName() string { } func NewBaseConfig() *BaseConfig { - return &BaseConfig{} + return &BaseConfig{ + Model: cool.NewModel(), + } } // Egg 性别配置模型(替换原宠物融合配方模型)