|
@ -1,6 +1,7 @@ |
|
|
package system |
|
|
package system |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
|
|
|
"errors" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"path/filepath" |
|
|
"path/filepath" |
|
|
"strings" |
|
|
"strings" |
|
@ -14,11 +15,20 @@ import ( |
|
|
"go.uber.org/zap" |
|
|
"go.uber.org/zap" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
var RepeatErr = errors.New("重复创建") |
|
|
|
|
|
|
|
|
type AutoCodeHistoryService struct { |
|
|
type AutoCodeHistoryService struct { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var AutoCodeHistoryServiceApp = new(AutoCodeHistoryService) |
|
|
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
|
|
|
// CreateAutoCodeHistory RouterPath : RouterPath@RouterString;RouterPath2@RouterString2
|
|
|
func (autoCodeHistoryService *AutoCodeHistoryService) CreateAutoCodeHistory(meta, structName, structCNName, autoCodePath string, injectionMeta string, tableName string, apiIds string) error { |
|
|
func (autoCodeHistoryService *AutoCodeHistoryService) CreateAutoCodeHistory(meta, structName, structCNName, autoCodePath string, injectionMeta string, tableName string, apiIds string) error { |
|
|
return global.GVA_DB.Create(&system.SysAutoCodeHistory{ |
|
|
return global.GVA_DB.Create(&system.SysAutoCodeHistory{ |
|
|