From 52c62cb26626c057d2ae2ebdc90164b95c847923 Mon Sep 17 00:00:00 2001 From: aceld Date: Wed, 3 Apr 2024 20:26:52 +0800 Subject: [PATCH 1/2] update --- test/caas/caas_demo1.go | 2 +- test/caas/caas_init1.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/caas/caas_demo1.go b/test/caas/caas_demo1.go index 4abdcae..d4c978c 100644 --- a/test/caas/caas_demo1.go +++ b/test/caas/caas_demo1.go @@ -6,7 +6,7 @@ import ( "github.com/aceld/kis-flow/kis" ) -// type CaaS func(context.Context, Connector, Function, Flow, interface{}) error +// type CaaS func(context.Context, Connector, Function, Flow, interface{}) (interface{}, error) func CaasDemoHanler1(ctx context.Context, conn kis.Connector, fn kis.Function, flow kis.Flow, args interface{}) (interface{}, error) { fmt.Printf("===> In CaasDemoHanler1: flowName: %s, cName:%s, fnName:%s, mode:%s\n", diff --git a/test/caas/caas_init1.go b/test/caas/caas_init1.go index 0ba141e..c600323 100644 --- a/test/caas/caas_init1.go +++ b/test/caas/caas_init1.go @@ -14,7 +14,7 @@ func InitConnDemo1(connector kis.Connector) error { fmt.Println(connConf) - // init connector , 如 初始化数据库链接等 + // init connector return nil } From 3cc8a70f179aa223f7cd30b34f085dac69e723fe Mon Sep 17 00:00:00 2001 From: aceld Date: Mon, 15 Apr 2024 10:44:57 +0800 Subject: [PATCH 2/2] add flow GetId() --- flow/kis_flow.go | 4 ++++ kis/flow.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/flow/kis_flow.go b/flow/kis_flow.go index 1ca0099..7427127 100644 --- a/flow/kis_flow.go +++ b/flow/kis_flow.go @@ -311,6 +311,10 @@ func (flow *KisFlow) GetName() string { return flow.Name } +func (flow *KisFlow) GetId() string { + return flow.Id +} + func (flow *KisFlow) GetThisFunction() kis.Function { return flow.ThisFunction } diff --git a/kis/flow.go b/kis/flow.go index 11d4b3e..0990e53 100644 --- a/kis/flow.go +++ b/kis/flow.go @@ -53,4 +53,6 @@ type Flow interface { GetFuncParamsAllFuncs() map[string]config.FParam // Fork 得到Flow的一个副本(深拷贝) Fork(ctx context.Context) Flow + // GetId 得到Flow的Id + GetId() string }