feat: issues #692

This commit is contained in:
songzhibin97
2021-09-10 11:57:27 +08:00
parent e5cf5695ff
commit f0969e09d3
2 changed files with 14 additions and 0 deletions
@@ -1,6 +1,7 @@
package system
import (
"errors"
"fmt"
"path/filepath"
"strings"
@@ -14,11 +15,20 @@ import (
"go.uber.org/zap"
)
var RepeatErr = errors.New("重复创建")
type AutoCodeHistoryService struct {
}
var AutoCodeHistoryServiceApp = new(AutoCodeHistoryService)
func (autoCodeHistoryService *AutoCodeHistoryService) Repeat(structName string) bool {
var count int64
global.GVA_DB.Model(&system.SysAutoCodeHistory{}).Where("struct_name = ?", structName).Count(&count)
return count > 0
}
// CreateAutoCodeHistory RouterPath : RouterPath@RouterString;RouterPath2@RouterString2
func (autoCodeHistoryService *AutoCodeHistoryService) CreateAutoCodeHistory(meta, structName, structCNName, autoCodePath string, injectionMeta string, tableName string, apiIds string) error {
return global.GVA_DB.Create(&system.SysAutoCodeHistory{