mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
[优化]
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"github.com/PandaXGO/PandaKit/utils"
|
||||
"pandax/apps/rule/entity"
|
||||
"pandax/apps/rule/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/kit/utils"
|
||||
"pandax/pkg/rule_engine"
|
||||
"strings"
|
||||
)
|
||||
@@ -84,7 +84,7 @@ func (p *RuleChainApi) GetRuleChain(rc *restfulx.ReqCtx) {
|
||||
func (p *RuleChainApi) InsertRuleChain(rc *restfulx.ReqCtx) {
|
||||
var data entity.RuleChain
|
||||
restfulx.BindJsonAndValid(rc, &data)
|
||||
data.Id = utils.GenerateID()
|
||||
data.Id = utils.GenerateID("rc")
|
||||
data.Owner = rc.LoginAccount.UserName
|
||||
data.OrgId = rc.LoginAccount.OrganizationId
|
||||
_, err := p.RuleChainApp.Insert(data)
|
||||
@@ -115,7 +115,7 @@ func (p *RuleChainApi) CloneRuleChain(rc *restfulx.ReqCtx) {
|
||||
one, err := p.RuleChainApp.FindOne(id)
|
||||
biz.ErrIsNil(err, "规则链不存在")
|
||||
one.RuleName = one.RuleName + "-克隆"
|
||||
one.Id = utils.GenerateID()
|
||||
one.Id = utils.GenerateID("rc")
|
||||
one.Root = "0"
|
||||
_, err = p.RuleChainApp.Insert(*one)
|
||||
biz.ErrIsNil(err, "克隆规则链失败")
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/PandaXGO/PandaKit/biz"
|
||||
"github.com/PandaXGO/PandaKit/model"
|
||||
"github.com/PandaXGO/PandaKit/restfulx"
|
||||
"pandax/apps/rule/entity"
|
||||
"pandax/apps/rule/services"
|
||||
"pandax/kit/biz"
|
||||
"pandax/kit/model"
|
||||
"pandax/kit/restfulx"
|
||||
"pandax/pkg/rule_engine/nodes"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user