mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-02-08 05:45:37 +08:00
feat: sql解析器替换、工单统一由‘我的流程’发起、流程定义支持自定义条件触发审批、资源隐藏编号、model支持物理删除等
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"mayfly-go/pkg/base"
|
||||
"mayfly-go/pkg/errorx"
|
||||
"mayfly-go/pkg/model"
|
||||
"mayfly-go/pkg/utils/stringx"
|
||||
)
|
||||
|
||||
type Mongo interface {
|
||||
@@ -84,9 +85,9 @@ func (d *mongoAppImpl) SaveMongo(ctx context.Context, m *entity.Mongo, tagCodePa
|
||||
if err == nil {
|
||||
return errorx.NewBiz("该名称已存在")
|
||||
}
|
||||
if d.CountByCond(&entity.Mongo{Code: m.Code}) > 0 {
|
||||
return errorx.NewBiz("该编码已存在")
|
||||
}
|
||||
|
||||
// 生成随机编号
|
||||
m.Code = stringx.Rand(10)
|
||||
|
||||
return d.Tx(ctx, func(ctx context.Context) error {
|
||||
return d.Insert(ctx, m)
|
||||
@@ -95,6 +96,7 @@ func (d *mongoAppImpl) SaveMongo(ctx context.Context, m *entity.Mongo, tagCodePa
|
||||
ResourceTag: &tagdto.ResourceTag{
|
||||
Type: tagentity.TagTypeMongo,
|
||||
Code: m.Code,
|
||||
Name: m.Name,
|
||||
},
|
||||
ParentTagCodePaths: tagCodePaths,
|
||||
})
|
||||
@@ -117,7 +119,7 @@ func (d *mongoAppImpl) SaveMongo(ctx context.Context, m *entity.Mongo, tagCodePa
|
||||
return d.UpdateById(ctx, m)
|
||||
}, func(ctx context.Context) error {
|
||||
if oldMongo.Name != m.Name {
|
||||
if err := d.tagApp.UpdateTagName(ctx, tagentity.TagTypeMachine, oldMongo.Code, m.Name); err != nil {
|
||||
if err := d.tagApp.UpdateTagName(ctx, tagentity.TagTypeMongo, oldMongo.Code, m.Name); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user