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)