2026-02-24 12:53:07 +08:00
|
|
|
package service
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"blazing/cool"
|
|
|
|
|
"blazing/modules/config/model"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type MapPitService struct {
|
|
|
|
|
*cool.Service
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewMapPitService() *MapPitService {
|
|
|
|
|
return &MapPitService{
|
|
|
|
|
&cool.Service{
|
|
|
|
|
Model: model.NewMapPit(),
|
|
|
|
|
PageQueryOp: &cool.QueryOp{
|
|
|
|
|
KeyWordField: []string{"remake"},
|
2026-02-24 19:20:38 +08:00
|
|
|
FieldEQ: []string{"map_id"},
|
2026-02-24 12:53:07 +08:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-02-25 16:18:10 +08:00
|
|
|
|
2026-03-02 23:59:15 +08:00
|
|
|
// func (s *MapPitService) GetData(mapid, pos uint32) []model.MapPit {
|
2026-02-25 16:18:10 +08:00
|
|
|
|
2026-03-02 23:59:15 +08:00
|
|
|
// var pet []model.MapPit //一个特性应该是唯一的,但是我们要获取默认随机特性
|
|
|
|
|
// dbm_enable(s.Model).Where("map_id", mapid).Wheref(`pos @> ARRAY[?]::integer[]`, pos).Scan(&pet)
|
2026-02-25 16:18:10 +08:00
|
|
|
|
2026-03-02 23:59:15 +08:00
|
|
|
// return pet
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
func (s *MapPitService) GetDataALL(mapid uint32) []model.MapPit {
|
2026-03-01 10:44:31 +08:00
|
|
|
|
|
|
|
|
var pet []model.MapPit //一个特性应该是唯一的,但是我们要获取默认随机特性
|
|
|
|
|
dbm_enable(s.Model).Where("map_id", mapid).Scan(&pet)
|
|
|
|
|
|
2026-03-02 23:59:15 +08:00
|
|
|
return pet
|
2026-03-01 10:44:31 +08:00
|
|
|
|
|
|
|
|
}
|
2026-03-24 02:21:50 +08:00
|
|
|
|
|
|
|
|
func (s *MapPitService) GetPet(petid uint32) []model.MapPit {
|
|
|
|
|
|
|
|
|
|
var pet []model.MapPit //一个特性应该是唯一的,但是我们要获取默认随机特性
|
2026-04-12 13:27:39 +08:00
|
|
|
dbm_enable(s.Model).Wheref(`? = ANY(refresh_id)`, petid).Scan(&pet)
|
2026-03-24 02:21:50 +08:00
|
|
|
|
|
|
|
|
return pet
|
|
|
|
|
|
|
|
|
|
}
|