feat(data): 重构颜色矩阵处理逻辑,将GlowFilter和相关功能迁移到common/data包
This commit is contained in:
35
modules/config/service/talkconfig.go
Normal file
35
modules/config/service/talkconfig.go
Normal file
@@ -0,0 +1,35 @@
|
||||
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
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user