review code.

This commit is contained in:
2026-04-17 14:50:34 +08:00
parent a0a6d6adaa
commit 592c8e31dd
15 changed files with 487 additions and 338 deletions

24
internal/impl/impl.go Normal file
View 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)
}