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

refactor(common/data/xmlres): 注释掉未使用的MonsterMap配置变量

- 将MonsterMap配置变量注释掉,因为当前不再使用该配置
- 相应地注释掉了初始化代码中的MonsterMap赋值逻辑

feat(logic/controller): 统一CanFight方法返回值为ErrorCode

- 修改PlayerFightBoss等战斗控制器中的Can
This commit is contained in:
昔念
2026-02-25 16:18:10 +08:00
parent 5e9ac0bef5
commit 7c1540ff6d
20 changed files with 284 additions and 272 deletions

View File

@@ -25,23 +25,24 @@ func NewBossService() *BossService {
}
}
func (s *BossService) Get(id uint32) *model.BossConfig {
func (s *BossService) Get(id uint32) []model.BossConfig {
if id == 0 {
return nil
}
var item *model.BossConfig
dbm_notenable(s.Model).Where("id", id).Scan(&item)
var item []model.BossConfig
dbm_notenable(s.Model).Where("id", id).WhereOr("parentId", id).OrderAsc("ordernum").Scan(&item)
return item
}
func (s *BossService) GetList(id uint32) []model.BossConfig {
var ret []model.BossConfig
// func (s *BossService) GetList(id uint32) []model.BossConfig {
// 执行 Raw SQL 并扫描返回值
dbm_nocache_noenable(s.Model).
Wheref(`map_id @> ARRAY[?]::integer[]`, id).WhereOrf(`map_id @> ARRAY[?]::integer[]`, 0).Scan(&ret)
// var ret []model.BossConfig
return ret
}
// // 执行 Raw SQL 并扫描返回值
// dbm_nocache_noenable(s.Model).
// Wheref(`map_id @> ARRAY[?]::integer[]`, id).WhereOrf(`map_id @> ARRAY[?]::integer[]`, 0).Scan(&ret)
// return ret
// }