package init

import (
	"flag"
	_ "github.com/go-sql-driver/mysql"
	"github.com/zeromicro/go-zero/core/conf"
	"jyBXBuyer/rpc/internal/config"
)

var configFile = flag.String("cf", "etc/bxbuyer.yaml", "the config file")
var C config.Config
var err error

var dbFile = flag.String("df", "etc/db.yaml", "the db file")
var DB config.Db

func init() {
	//基本配置
	conf.MustLoad(*configFile, &C)
	//数据库配置
	conf.MustLoad(*dbFile, &DB)
	//初始mongodb
	MongoDBInit(&DB.Mongo)
	//初始化msyql
	MysqlInit(&DB.Mysql)
	//初始redis
	RedisInit(&DB.Redis)
	//初始es
	EsInit(&DB.Es)
}
