All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
feat(config): 添加超时空地图配置和时间地图查询功能 新增IsTimeSpace字段用于标识地图是否为超时空地图, 添加TimeMap API接口支持查询超时空地图配置 perf(socket): 优化XORDecryptU解密函数减少内存分配 基于bytebufferpool实现缓冲区池化,大幅降低高频调用下的 内存分配和GC压力,提升性能表现 refactor(utils): 优化packVal序列化函数提升性能和稳定性 减少反射开销,
41 lines
772 B
Go
41 lines
772 B
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"},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
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
|
|
|
|
}
|