refactor(common/utils): 重构concurrent_swiss_map使用官方sync.Map实现 - 替换原有的第三方并发map实现,改为基于标准库sync.Map的封装 - 保持完全的API兼容性,原有配置方法变为无实际作用的占位符 - 优化Range方法实现,移除goroutine/channel开销,避免潜在的死锁风险 - 移除依赖的外部库和
This commit is contained in:
@@ -11,12 +11,11 @@ const (
|
||||
TableNameBraveTowerConfig = "config_tower_600" // 勇者之塔600配置表
|
||||
)
|
||||
|
||||
// -------------------------- 核心基类:所有塔配置的通用结构 --------------------------
|
||||
type BaseTowerConfig struct {
|
||||
*BaseConfig
|
||||
|
||||
TowerLevel uint32 `gorm:"not null;default:0;uniqueIndex;comment:'塔层数(唯一标识每层配置)'" json:"tower_level" description:"塔层数"`
|
||||
BossIds []uint32 `gorm:"not null;type:jsonb;default:'[]';comment:'绑定BOSS ID数组,关联config_pet_boss表主键'" json:"boss_ids" description:"绑定BOSS数组"`
|
||||
Name string `gorm:"type:varchar(100);default:'';comment:'塔名称'" json:"name" description:"塔名称"`
|
||||
TowerLevel uint32 `gorm:"not null;default:0;uniqueIndex;comment:'塔层数'" json:"tower_level" `
|
||||
BossIds []uint32 `gorm:"not null;type:jsonb;default:'[]';comment:'绑定BOSS ID数组'" json:"boss_ids" `
|
||||
}
|
||||
|
||||
// NewBaseTowerConfig 创建基础塔配置实例(所有塔类型共用)
|
||||
@@ -26,9 +25,6 @@ func NewBaseTowerConfig() *BaseTowerConfig {
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------- 各塔类型专属配置模型(无额外字段,仅绑定不同表名)--------------------------
|
||||
|
||||
// Tower110Config 勇者之塔110配置模型
|
||||
type Tower110Config struct {
|
||||
*BaseTowerConfig
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user