Files
bl/modules/config/service/talkconfig.go

36 lines
663 B
Go

package service
import (
"blazing/cool"
"blazing/modules/config/model"
"github.com/gogf/gf/v2/database/gdb"
)
type TalkConfigService struct {
*cool.Service
}
var TalkConfigServiceS = NewTalkConfigService()
func NewTalkConfigService() *TalkConfigService {
return &TalkConfigService{
Service: &cool.Service{Model: model.NewMineralCollectionConfig()},
// Cache: gcache.New()},
}
}
func (s *TalkConfigService) GetCache(flag int) []model.MineralCollectionConfig {
var config []model.MineralCollectionConfig
cool.DBM(s.Model).Where("type", flag).Cache(gdb.CacheOption{
// Duration: time.Hour,
Force: false,
}).Scan(&config)
return config
}