25 lines
597 B
Go
25 lines
597 B
Go
package impl
|
|
|
|
import (
|
|
"git.apinb.com/bsm-sdk/core/cache/redis"
|
|
"git.apinb.com/bsm-sdk/core/conf"
|
|
"git.apinb.com/bsm-sdk/core/with"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
var (
|
|
CacheUrl = "redis://null:Weidong2023~!@139.224.247.176:19379/0"
|
|
DBSources = []string{"host=139.224.247.176 user=postgres password=Stock0310~! dbname=stock_prod port=19432 sslmode=disable"}
|
|
RedisService *redis.RedisClient
|
|
DBService *gorm.DB
|
|
)
|
|
|
|
func NewImpl() {
|
|
RedisService = with.RedisCache(CacheUrl) // redis cache
|
|
// model
|
|
DBService = with.Databases(&conf.DBConf{
|
|
Driver: "postgres",
|
|
Source: DBSources,
|
|
}, nil)
|
|
}
|