From 3e7f8513eb1fac04ea0521fb385e18b5fe14231d Mon Sep 17 00:00:00 2001 From: mr Date: Thu, 17 Oct 2024 16:04:07 +0200 Subject: [PATCH] nats discovery --- tools/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/api.go b/tools/api.go index 95ccf15..cdd7878 100644 --- a/tools/api.go +++ b/tools/api.go @@ -86,10 +86,10 @@ func (a *API) ListenRouter(exec func(msg map[string]interface{})) { go NewNATSCaller().ListenNats(DISCOVERY.GenerateKey("api"), exec) } -func (a *API) SubscribeRouter() { +func (a *API) SubscribeRouter(infos []*beego.ControllerInfo) { nats := NewNATSCaller() discovery := map[string]interface{}{} - for _, info := range beego.BeeApp.Handlers.GetAllControllerInfo() { + for _, info := range infos { methods := []string{} for k := range info.GetMethod() { methods = append(methods, k)