package main

import (
	"gorm.io/gorm"
	"ppms-fj/global"
	"ppms-fj/inits"
)

func init() {
	// 初始化配置
	inits.BuildConfig("", "col-comment")
	// 初始化日志
	logOpt := inits.NewLoggerOption(global.Config)
	logOpt.BuildLogger()
	dbMap := make(map[string]*gorm.DB)
	// 初始化数据库
	for dbName, dbInfo := range global.Config.DBMap {
		dbOption := inits.NewDBOption(dbInfo)
		db, err := dbOption.GetGormConnect()
		if err != nil {
			panic(err)
		}
		dbMap[dbName] = db
	}
	global.DBMap = &dbMap
}

// 表注释添加
func main() {

}
