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

feat(utils): 添加切片元素计数功能

新增CountSliceElements函数用于统计切片中各元素的出现次数,
返回map[元素]出现次数的映射关系,支持任意可比较类型的切片元素。

fix(config): 调整地图配置模型默认值设置

修改MapPit结构体中的MinLevel和MaxLevel字段设置,
将数据库约束改为非空并设置默认值为1,确保等级范围配置的有效性。

ref
This commit is contained in:
昔念
2026-02-26 22:32:15 +08:00
parent 21ae004979
commit bfafd5789d
4 changed files with 36 additions and 34 deletions

View File

@@ -63,6 +63,8 @@ func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result
}
//c.Service.Item.UPDATEM(data.Item1[:], -1)
// utils.CountSliceElements(data.Item1[:])
for _, v := range data.Item1 {
c.Service.Item.UPDATE(v, -1)