自动化回滚可以回滚gorm.go 和 router.go

This commit is contained in:
piexlmax
2023-03-11 18:26:55 +08:00
parent 27158f7075
commit d8072634ef
3 changed files with 172 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import (
"errors"
"fmt"
systemReq "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
"github.com/flipped-aurora/gin-vue-admin/server/utils/ast"
"path/filepath"
"strconv"
"strings"
@@ -120,6 +121,9 @@ func (autoCodeHistoryService *AutoCodeHistoryService) RollBack(info *systemReq.R
_ = utils.AutoClearCode(meta[0], meta[2])
}
}
ast.RollBackAst(md.Package, md.StructName)
md.Flag = 1
return global.GVA_DB.Save(&md).Error
}