feature:自动创建基本菜单

This commit is contained in:
piexlMax
2024-03-27 20:55:03 +08:00
parent 3c2595aaf9
commit 26cdb472f0
6 changed files with 64 additions and 26 deletions

View File

@@ -30,7 +30,7 @@ var AutoCodeHistoryServiceApp = new(AutoCodeHistoryService)
// RouterPath : RouterPath@RouterString;RouterPath2@RouterString2
// Author [SliverHorn](https://github.com/SliverHorn)
// Author [songzhibin97](https://github.com/songzhibin97)
func (autoCodeHistoryService *AutoCodeHistoryService) CreateAutoCodeHistory(meta, structName, structCNName, autoCodePath string, injectionMeta string, tableName string, apiIds string, Package string, BusinessDB string) error {
func (autoCodeHistoryService *AutoCodeHistoryService) CreateAutoCodeHistory(meta, structName, structCNName, autoCodePath string, injectionMeta string, tableName string, apiIds string, Package string, BusinessDB string, menuID uint) error {
return global.GVA_DB.Create(&system.SysAutoCodeHistory{
Package: Package,
RequestMeta: meta,
@@ -81,9 +81,17 @@ func (autoCodeHistoryService *AutoCodeHistoryService) RollBack(info *systemReq.R
ids.Ids = append(ids.Ids, id)
}
err := ApiServiceApp.DeleteApisByIds(ids)
if err != nil {
global.GVA_LOG.Error("ClearTag DeleteApiByIds:", zap.Error(err))
}
err = BaseMenuServiceApp.DeleteBaseMenu(int(md.MenuID))
if err != nil {
global.GVA_LOG.Error("ClearTag DeleteBaseMenu:", zap.Error(err))
}
// 删除表
if info.DeleteTable {
if err = AutoCodeServiceApp.DropTable(md.BusinessDB, md.TableName); err != nil {