All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
将地图热度信息从简单的计数器改为包含提示信息的结构体 添加矿物、BOSS、宠物和掉落等提示信息的收集功能 优化地图进入和离开时的计数逻辑
52 lines
1.0 KiB
Go
52 lines
1.0 KiB
Go
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"},
|
|
FieldEQ: []string{"map_id"},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
func (s *MapService) GetData(p1 uint32) (ret *model.MapConfig) {
|
|
//cacheKey := strings.Join([]string{fmt.Sprintf("%d", p1), fmt.Sprintf("%d", p2)}, ":")
|
|
m := dbm_notenable(s.Model)
|
|
|
|
m.Where(`map_id`, p1).Scan(&ret)
|
|
|
|
return
|
|
|
|
}
|
|
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
|
|
|
|
}
|
|
|
|
// func (s *MapService) GetTimeTip() (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
|
|
|
|
// }
|