From 622a368a25ef43424a60aba896ed31df61927165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Wed, 7 Aug 2024 16:41:37 +0800 Subject: [PATCH] =?UTF-8?q?config=20=E5=8A=A8=E6=80=81=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E8=BF=9B=E6=9D=A5=E4=BA=86=E7=9A=84=EF=BC=8C=E6=B2=A1=E6=B3=95?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E7=9A=84=E5=8A=A0=E8=BD=BD=E8=BF=9B?= =?UTF-8?q?=E5=8E=BB=EF=BC=8C=E9=BA=BB=E7=83=A6=EF=BC=8C=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E4=BC=A0=E9=80=92=E8=BF=87=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- instance/instance.go | 4 +--- manage/conf.go | 3 +-- manage/manage.go | 13 ++++++------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/instance/instance.go b/instance/instance.go index 4e4f89c..d0c4245 100644 --- a/instance/instance.go +++ b/instance/instance.go @@ -11,7 +11,7 @@ func Order(ctx context.Context, tag string, request *proto.OrderRequest) (*proto if err != nil { return nil, err } - request.Config = srv.Config + //request.Config = srv.Config return srv.Impl.Order(ctx, request) } @@ -20,7 +20,6 @@ func Query(ctx context.Context, tag string, request *proto.QueryRequest) (*proto if err != nil { return nil, err } - request.Config = srv.Config return srv.Impl.Query(ctx, request) } @@ -29,6 +28,5 @@ func Notify(ctx context.Context, tag string, request *proto.NotifyRequest) (*pro if err != nil { return nil, err } - request.Config = srv.Config return srv.Impl.Notify(ctx, request) } diff --git a/manage/conf.go b/manage/conf.go index d598c4c..6bc605e 100644 --- a/manage/conf.go +++ b/manage/conf.go @@ -1,7 +1,6 @@ package manage import ( - "encoding/json" "fmt" "gitea.cdlsxd.cn/BaseSystem/plugin/shared" "github.com/go-playground/validator/v10" @@ -20,7 +19,7 @@ type Config struct { Timeout time.Duration // 插件超时时间 // 供应商配置 - Config json.RawMessage + // Config json.RawMessage } func (c *Config) Validate() error { diff --git a/manage/manage.go b/manage/manage.go index a311c1c..c8eda00 100644 --- a/manage/manage.go +++ b/manage/manage.go @@ -1,15 +1,14 @@ package manage import ( - "encoding/json" "fmt" "gitea.cdlsxd.cn/BaseSystem/plugin/shared" ) type PluginInfo struct { - Tag string - Impl shared.PluginService - Config json.RawMessage + Tag string + Impl shared.PluginService + //Config json.RawMessage cleanup func() } @@ -34,9 +33,9 @@ func (m *pluginManage) add(c *Config) error { return err } m.plugins[c.Tag] = &PluginInfo{ - Tag: c.Tag, - Impl: impl, - Config: c.Config, + Tag: c.Tag, + Impl: impl, + //Config: c.Config, cleanup: cleanup, } return nil