Files
bl/modules/blazing/service/effect.go
昔念 78bb2bd148 ```
refactor(dict): 调整缓存逻辑并优化数据获取方式

将原先基于 gcache 的缓存机制移除,改为使用 gdb 内置的
2025-12-15 06:15:55 +08:00

36 lines
586 B
Go

package service
import (
"blazing/cool"
"blazing/modules/blazing/model"
"github.com/gogf/gf/v2/database/gdb"
)
type EffectService struct {
*cool.Service
}
func (s *EffectService) Args(id uint32) (int, []int) {
m := cool.DBM(s.Model).Where("se_idx", id).Cache(gdb.CacheOption{
//Duration: time.Hour,
Force: false,
})
var tt model.PlayerPetSpecialEffect
m.Scan(&tt)
return int(tt.Eid), tt.Args
}
func NewEffectService() *EffectService {
return &EffectService{
&cool.Service{
Model: model.NewPlayerPetSpecialEffect(),
},
}
}
var Effects = NewEffectService()