feat: sql解析器替换、工单统一由‘我的流程’发起、流程定义支持自定义条件触发审批、资源隐藏编号、model支持物理删除等

This commit is contained in:
meilin.huang
2024-10-16 17:24:50 +08:00
parent 43edef412c
commit e135e4ce64
170 changed files with 397197 additions and 1251 deletions

View File

@@ -16,6 +16,7 @@ import (
"mayfly-go/pkg/logx"
"mayfly-go/pkg/model"
"mayfly-go/pkg/utils/collx"
"mayfly-go/pkg/utils/stringx"
"mayfly-go/pkg/utils/structx"
)
@@ -104,10 +105,12 @@ func (app *instanceAppImpl) SaveDbInstance(ctx context.Context, instance *dto.Sa
if err == nil {
return 0, errorx.NewBiz("该数据库实例已存在")
}
if app.CountByCond(&entity.DbInstance{Code: instanceEntity.Code}) > 0 {
return 0, errorx.NewBiz("该编码已存在")
if app.CountByCond(&entity.DbInstance{Name: instanceEntity.Name}) > 0 {
return 0, errorx.NewBiz("该名称已存在")
}
instanceEntity.Code = stringx.Rand(10)
return instanceEntity.Id, app.Tx(ctx, func(ctx context.Context) error {
return app.Insert(ctx, instanceEntity)
}, func(ctx context.Context) error {
@@ -152,7 +155,7 @@ func (app *instanceAppImpl) SaveDbInstance(ctx context.Context, instance *dto.Sa
}
}
return app.tagApp.SaveResourceTag(ctx, &tagdto.SaveResourceTag{
ResourceTag: app.genDbInstanceResourceTag(instanceEntity, authCerts),
ResourceTag: app.genDbInstanceResourceTag(oldInstance, authCerts),
ParentTagCodePaths: tagCodePaths,
})
})