package main

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

func init() {
	// 初始化配置
	inits.BuildConfig("", "col-comment")
	// 初始化数据库
	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() {
	services.GenerateFjsj()
}
