19 lines
517 B
Go
19 lines
517 B
Go
package db
|
|
|
|
import (
|
|
"github.com/google/wire"
|
|
"gorm.io/gorm"
|
|
bundleConfig "micro-bundle/config"
|
|
"strings"
|
|
)
|
|
|
|
var Provider = wire.NewSet(NewBundleDB)
|
|
|
|
func NewBundleDB() *gorm.DB {
|
|
connBundleDB := strings.Join([]string{bundleConfig.Data.ChainDci.User, ":", bundleConfig.Data.ChainDci.Password,
|
|
"@tcp(", bundleConfig.Data.ChainDci.Host, ":", bundleConfig.Data.ChainDci.Port, ")/",
|
|
bundleConfig.Data.ChainDci.DbName, "?charset=utf8mb4&parseTime=true"}, "")
|
|
DciDB := loadMysqlConn(connBundleDB)
|
|
return DciDB
|
|
}
|