22 lines
449 B
Go
22 lines
449 B
Go
package impl
|
|
|
|
import (
|
|
"git.apinb.com/bsm-sdk/core/cache/redis"
|
|
"git.apinb.com/bsm-sdk/core/with"
|
|
"git.apinb.com/quant/gostock/internal/config"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
var (
|
|
RedisService *redis.RedisClient // Redis 客户端服务
|
|
DBService *gorm.DB
|
|
)
|
|
|
|
func NewImpl() {
|
|
// 初始化 Redis 缓存
|
|
RedisService = with.RedisCache(config.Spec.Cache)
|
|
DBService = with.Databases(config.Spec.Databases, nil) // model
|
|
|
|
with.Logger(config.Spec.Log)
|
|
}
|