nats discovery

This commit is contained in:
mr 2024-10-17 16:04:07 +02:00
parent 1561d0c81e
commit 3e7f8513eb

View File

@ -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)