Files
bl/modules/config/model/map_monster.go
昔念 1dc75b529d
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
```
feat(socket): 优化TCP连接处理性能

- 添加最小可读长度检查,避免无效Peek操作
- 修复数据部分解析逻辑,避免空切片分配

perf(utils): 优化并发哈希映射性能

- 将分段数量调整为CPU核心数
- 重写Range方法,移除channel和goroutine开销
- 添加原子标志控制遍历终止

perf(utils): 优化结构体序列化缓存机制

- 添加sync.Map缓存预处理结果
- 支持结构体、自定义类型、二进制类型分别缓存
- 减少重复反射
2026-02-22 10:59:41 +08:00

57 lines
2.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
import (
"blazing/cool"
)
const (
TableNameMonsterRefresh = "config_monster_refresh" // 怪物刷新规则表(地图-精灵等级-刷新脚本配置)
)
// MonsterRefresh 怪物刷新规则模型(对应前端配置的地图/精灵/等级/脚本配置)
type MonsterRefresh struct {
*BaseConfig
MapID int32 `gorm:"not null;comment:'地图ID'" json:"map_id"`
PitID1 []int32 `gorm:"type:int[];not null;comment:'坑位1绑定的坑位ID列表多绑循环刷'" json:"pit_id_1"`
PitID2 []int32 `gorm:"type:int[];not null;comment:'坑位2绑定的坑位ID列表多绑循环刷'" json:"pit_id_2"`
PitID3 []int32 `gorm:"type:int[];not null;comment:'坑位3绑定的坑位ID列表多绑循环刷'" json:"pit_id_3"`
PitID4 []int32 `gorm:"type:int[];not null;comment:'坑位4绑定的坑位ID列表多绑循环刷'" json:"pit_id_4"`
PitID5 []int32 `gorm:"type:int[];not null;comment:'坑位5绑定的坑位ID列表多绑循环刷'" json:"pit_id_5"`
PitID6 []int32 `gorm:"type:int[];not null;comment:'坑位6绑定的坑位ID列表多绑循环刷'" json:"pit_id_6"`
PitID7 []int32 `gorm:"type:int[];not null;comment:'坑位7绑定的坑位ID列表多绑循环刷'" json:"pit_id_7"`
PitID8 []int32 `gorm:"type:int[];not null;comment:'坑位8绑定的坑位ID列表多绑循环刷'" json:"pit_id_8"`
PitID9 []int32 `gorm:"type:int[];not null;comment:'坑位9绑定的坑位ID列表多绑循环刷'" json:"pit_id_9"`
}
type MonsterRefreshEX struct {
MonsterRefresh
MonsterID []uint32 `json:"monster_id"`
ShinyID []uint32 `json:"shiny_id"`
// 扩展便于批量处理9个坑位
PitIDs [9][]uint32 `json:"pit_ids"` // 整合所有坑位ID前端/业务层批量处理用
}
// TableName 指定MonsterRefresh对应的数据库表名
func (*MonsterRefresh) TableName() string {
return TableNameMonsterRefresh
}
// GroupName 指定表所属的分组(保持和参考示例一致)
func (*MonsterRefresh) GroupName() string {
return "default"
}
// NewMonsterRefresh 创建一个新的MonsterRefresh实例初始化通用Model
func NewMonsterRefresh() *MonsterRefresh {
return &MonsterRefresh{
BaseConfig: NewBaseConfig(),
}
}
// init 初始化表结构(程序启动时自动创建/同步表)
func init() {
cool.CreateTable(&MonsterRefresh{})
}