All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
feat(player): 添加称号重复检查逻辑 防止玩家重复获得相同称号,提升系统稳定性 fix(config): 修复boss配置相关代码问题 - 新增BossController的GetList接口 - 优化import语句顺序 - 修正PetBaseConfig中Desc字段为Remark字段 - 移除Tower配置中的TaskIds冗余字段 - 完善ShopConfig字段注释内容 ```
43 lines
777 B
Go
43 lines
777 B
Go
package service
|
|
|
|
import (
|
|
"blazing/cool"
|
|
"blazing/modules/config/model"
|
|
)
|
|
|
|
type BossService struct {
|
|
*cool.Service
|
|
}
|
|
|
|
func NewBossService() *BossService {
|
|
return &BossService{
|
|
&cool.Service{
|
|
Model: model.NewBossConfig(),
|
|
PageQueryOp: &cool.QueryOp{
|
|
KeyWordField: []string{"desc"},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
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)
|
|
|
|
return item
|
|
|
|
}
|
|
func (s *BossService) GetList(id uint32) []model.BossConfig {
|
|
|
|
var ret []model.BossConfig
|
|
|
|
// 执行 Raw SQL 并扫描返回值
|
|
dbm_nocache_noenable(s.Model).
|
|
Wheref(`map_id @> ARRAY[?]::integer[]`, id).WhereOrf(`map_id @> ARRAY[?]::integer[]`, 0).Scan(&ret)
|
|
|
|
return ret
|
|
}
|