```
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

refactor(common/utils): 重构concurrent_swiss_map使用官方sync.Map实现

- 替换原有的第三方并发map实现,改为基于标准库sync.Map的封装
- 保持完全的API兼容性,原有配置方法变为无实际作用的占位符
- 优化Range方法实现,移除goroutine/channel开销,避免潜在的死锁风险
- 移除依赖的外部库和
This commit is contained in:
昔念
2026-02-25 13:20:38 +08:00
parent 931809edc4
commit c00a796203
10 changed files with 140 additions and 331 deletions

View File

@@ -13,11 +13,14 @@ type BossConfig struct {
*cool.Model // 嵌入通用Model包含ID/创建时间/更新时间等通用字段)
PetBaseConfig
MapID int32 `gorm:"not null;index;comment:'所属地图ID'" json:"map_id" description:"地图ID"`
BossID int32 `gorm:"not null;index;comment:'所属BOSSID'" json:"boss_id" description:"BOSSID"`
Order int32 `gorm:"not null;comment:'排序'" json:"order" description:"排序"`
MapID int32 `gorm:"not null;index;comment:'所属地图ID'" json:"map_id" description:"地图ID"`
Script string `gorm:"size:1024;default:'';comment:'BOSS脚本'" json:"script"` //boss出招逻辑做成js脚本
Ordernum int32 `gorm:"not null;comment:'排序'" json:"ordernum" description:"排序"`
ParentID int32 `gorm:"column:parentId;type:int" json:"parentId"` // 父ID
Remark string `gorm:"comment:'BOSS备注'" json:"remark"`
//是否可捕捉MapPit
IsCapture int `gorm:"type:int;default:0;comment:'是否可捕捉'" json:"is_capture"`
Script string `gorm:"size:1024;default:'';comment:'BOSS脚本'" json:"script"` //boss出招逻辑做成js脚本
}