mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-22 04:56:49 +08:00
优化蓝图执行器
This commit is contained in:
@@ -6,10 +6,11 @@ import (
|
||||
|
||||
"github.com/duanhf2012/origin/v2/service"
|
||||
"github.com/goccy/go-json"
|
||||
"github.com/duanhf2012/origin/v2/log"
|
||||
)
|
||||
|
||||
const ReturnVarial = "g_Return"
|
||||
|
||||
var IsDebug = false
|
||||
type IGraph interface {
|
||||
Do(entranceID int64, args ...any) (Port_Array, error)
|
||||
Release()
|
||||
@@ -28,6 +29,7 @@ type baseGraph struct {
|
||||
}
|
||||
|
||||
type Graph struct {
|
||||
graphFileName string
|
||||
graphID int64
|
||||
*baseGraph
|
||||
graphContext
|
||||
@@ -137,6 +139,10 @@ func (gc *graphConfig) GetNodeByID(nodeID string) *nodeConfig {
|
||||
}
|
||||
|
||||
func (gr *Graph) Do(entranceID int64, args ...any) (Port_Array, error) {
|
||||
if IsDebug {
|
||||
log.Debug("Graph Do", log.String("graphName",gr.graphFileName),log.Int64("graphID", gr.graphID), log.Int64("entranceID", entranceID))
|
||||
}
|
||||
|
||||
entranceNode := gr.entrance[entranceID]
|
||||
if entranceNode == nil {
|
||||
return nil, fmt.Errorf("entranceID:%d not found", entranceID)
|
||||
|
||||
Reference in New Issue
Block a user