Skip to content

Commit

Permalink
feat: 调整逻辑无论是否创建菜单或API都注册自动化代码历史 (#1804)
Browse files Browse the repository at this point in the history
* feat: 调整逻辑无论是否创建菜单或API都注册自动化代码历史

---------

Co-authored-by: wall-js <[email protected]>
  • Loading branch information
wall-js and wall-js authored Jul 1, 2024
1 parent a4f139f commit d497e96
Showing 1 changed file with 26 additions and 28 deletions.
54 changes: 26 additions & 28 deletions server/service/system/sys_auto_code.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,34 +303,32 @@ func (autoCodeService *AutoCodeService) CreateTemp(autoCode system.AutoCodeStruc
bf.WriteString(";")
}
}
if autoCode.AutoCreateApiToSql || autoCode.AutoCreateMenuToSql {
if autoCode.TableName != "" {
err = AutoCodeHistoryServiceApp.CreateAutoCodeHistory(
string(meta),
autoCode.StructName,
autoCode.Description,
bf.String(),
injectionCodeMeta.String(),
autoCode.TableName,
idBf.String(),
autoCode.Package,
autoCode.BusinessDB,
menuID,
)
} else {
err = AutoCodeHistoryServiceApp.CreateAutoCodeHistory(
string(meta),
autoCode.StructName,
autoCode.Description,
bf.String(),
injectionCodeMeta.String(),
autoCode.StructName,
idBf.String(),
autoCode.Package,
autoCode.BusinessDB,
menuID,
)
}
if autoCode.TableName != "" {
err = AutoCodeHistoryServiceApp.CreateAutoCodeHistory(
string(meta),
autoCode.StructName,
autoCode.Description,
bf.String(),
injectionCodeMeta.String(),
autoCode.TableName,
idBf.String(),
autoCode.Package,
autoCode.BusinessDB,
menuID,
)
} else {
err = AutoCodeHistoryServiceApp.CreateAutoCodeHistory(
string(meta),
autoCode.StructName,
autoCode.Description,
bf.String(),
injectionCodeMeta.String(),
autoCode.StructName,
idBf.String(),
autoCode.Package,
autoCode.BusinessDB,
menuID,
)
}
if err != nil {
return err
Expand Down

0 comments on commit d497e96

Please sign in to comment.