自动化代码不同包结构体不再冲突

This commit is contained in:
piexlmax
2022-03-26 14:44:23 +08:00
parent d96b963385
commit 0b8e15cad1
3 changed files with 67 additions and 64 deletions
@@ -27,8 +27,9 @@ 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) error {
func (autoCodeHistoryService *AutoCodeHistoryService) CreateAutoCodeHistory(meta, structName, structCNName, autoCodePath string, injectionMeta string, tableName string, apiIds string, Package string) error {
return global.GVA_DB.Create(&system.SysAutoCodeHistory{
Package: Package,
RequestMeta: meta,
AutoCodePath: autoCodePath,
InjectionMeta: injectionMeta,
@@ -50,9 +51,9 @@ func (autoCodeHistoryService *AutoCodeHistoryService) First(info *request.GetByI
// Repeat 检测重复
// Author [SliverHorn](https://github.com/SliverHorn)
// Author [songzhibin97](https://github.com/songzhibin97)
func (autoCodeHistoryService *AutoCodeHistoryService) Repeat(structName string) bool {
func (autoCodeHistoryService *AutoCodeHistoryService) Repeat(structName string, Package string) bool {
var count int64
global.GVA_DB.Model(&system.SysAutoCodeHistory{}).Where("struct_name = ? and flag = 0", structName).Count(&count)
global.GVA_DB.Model(&system.SysAutoCodeHistory{}).Where("struct_name = ? and package = ? and flag = 0", structName, Package).Count(&count)
return count > 0
}