2026-02-20 21:34:27 +08:00
|
|
|
package service
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"blazing/cool"
|
|
|
|
|
"blazing/modules/config/model"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type MapService struct {
|
|
|
|
|
*cool.Service
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewMapService() *MapService {
|
|
|
|
|
return &MapService{
|
|
|
|
|
&cool.Service{
|
|
|
|
|
Model: model.NewMapConfig(),
|
|
|
|
|
PageQueryOp: &cool.QueryOp{
|
|
|
|
|
KeyWordField: []string{"remake"},
|
2026-02-25 13:20:38 +08:00
|
|
|
FieldEQ: []string{"map_id"},
|
2026-02-20 21:34:27 +08:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *MapService) GetData(p1 uint32) (ret *model.MapConfig) {
|
|
|
|
|
//cacheKey := strings.Join([]string{fmt.Sprintf("%d", p1), fmt.Sprintf("%d", p2)}, ":")
|
2026-02-20 22:39:04 +08:00
|
|
|
m := dbm_notenable(s.Model)
|
2026-02-20 21:34:27 +08:00
|
|
|
|
2026-02-20 23:33:24 +08:00
|
|
|
m.Where(`map_id`, p1).Scan(&ret)
|
2026-02-20 21:34:27 +08:00
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
}
|
2026-02-21 16:48:42 +08:00
|
|
|
func (s *MapService) GetTimeMap() (ret []model.MapConfig) {
|
|
|
|
|
//cacheKey := strings.Join([]string{fmt.Sprintf("%d", p1), fmt.Sprintf("%d", p2)}, ":")
|
|
|
|
|
m := dbm_notenable(s.Model)
|
|
|
|
|
|
|
|
|
|
m.Where(`is_time_space`, 1).Scan(&ret)
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
}
|