review code.
This commit is contained in:
24
internal/impl/impl.go
Normal file
24
internal/impl/impl.go
Normal file
@@ -0,0 +1,24 @@
|
||||
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 TimeZone=Asia/Shanghai"}
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user