discovery clear view

This commit is contained in:
mr 2025-02-19 15:29:42 +01:00
parent 3ecb0e9d96
commit 5111c9c8be

View File

@ -3,6 +3,7 @@ package tools
import (
"encoding/json"
"errors"
"fmt"
"strings"
"cloud.o-forge.io/core/oc-lib/config"
@ -97,6 +98,7 @@ func (a *API) SubscribeRouter(infos []*beego.ControllerInfo) {
nats := NewNATSCaller()
discovery := map[string][]string{}
for _, info := range infos {
fmt.Println("DISCOVERY", info.GetPattern())
path := strings.ReplaceAll(info.GetPattern(), "/oc/", "/"+strings.ReplaceAll(config.GetAppName(), "oc-", ""))
for k, v := range info.GetMethod() {
if discovery[path] == nil {