fix: 代码生成器 结构体简称发生的关键字冲突 #1089

This commit is contained in:
SliverHorn
2022-05-27 13:50:27 +08:00
parent 95fd9f92cd
commit 0eae201401
2 changed files with 11 additions and 1 deletions

View File

@@ -38,7 +38,7 @@ func (autoApi *AutoCodeApi) PreviewTemp(c *gin.Context) {
response.FailWithMessage(err.Error(), c)
return
}
a.KeyWord() // 处理go关键字
a.PackageT = caser.String(a.Package)
autoCode, err := autoCodeService.PreviewTemp(a)
if err != nil {
@@ -65,6 +65,7 @@ func (autoApi *AutoCodeApi) CreateTemp(c *gin.Context) {
response.FailWithMessage(err.Error(), c)
return
}
a.KeyWord() // 处理go关键字
var apiIds []uint
if a.AutoCreateApiToSql {
if ids, err := autoCodeService.AutoCreateApi(&a); err != nil {