[fixed]修复业务库生成代码gorm自动迁移数据库name错误的问题。

This commit is contained in:
piexlMax
2023-09-08 16:37:58 +08:00
parent 7bfea23958
commit 2fbed17ebc
2 changed files with 9 additions and 8 deletions
+2 -2
View File
@@ -321,8 +321,8 @@ func (autoCodeService *AutoCodeService) CreateTemp(autoCode system.AutoCodeStruc
// 在gorm.go 注入 自动迁移
path := filepath.Join(global.GVA_CONFIG.AutoCode.Root,
global.GVA_CONFIG.AutoCode.Server, global.GVA_CONFIG.AutoCode.SInitialize, "gorm.go")
autoCode.BusinessDB = utils.MaheHump(autoCode.BusinessDB) // 这里将 数据库中间存在 - 的转换为驼峰
ast2.AddRegisterTablesAst(path, "RegisterTables", autoCode.Package, autoCode.BusinessDB, autoCode.StructName)
varDB := utils.MaheHump(autoCode.BusinessDB)
ast2.AddRegisterTablesAst(path, "RegisterTables", autoCode.Package, varDB, autoCode.BusinessDB, autoCode.StructName)
}
{