X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=capifcore%2Finternal%2Fpublishservice%2Fpublishservice.go;h=09c4ef7cd0704ab07c455f8e06f737717d9d8400;hb=8ff4d0377ccd9b3c10bc9fb247b7136bba3eb6d7;hp=670d2ed53c9c5e69712579913f3287eb005bc16d;hpb=8fa464fbe92fe7fa2107915accfe93cb932fb021;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/publishservice/publishservice.go b/capifcore/internal/publishservice/publishservice.go index 670d2ed..09c4ef7 100644 --- a/capifcore/internal/publishservice/publishservice.go +++ b/capifcore/internal/publishservice/publishservice.go @@ -97,11 +97,11 @@ func (ps *PublishService) GetAllPublishedServices() []publishapi.ServiceAPIDescr func (ps *PublishService) GetAllowedPublishedServices(apiListRequestedServices []publishapi.ServiceAPIDescription) []publishapi.ServiceAPIDescription { apiListAllPublished := ps.GetAllPublishedServices() - allowedPublishedServices := intersection(apiListAllPublished, apiListRequestedServices) + allowedPublishedServices := join(apiListAllPublished, apiListRequestedServices) return allowedPublishedServices } -func intersection(a, b []publishapi.ServiceAPIDescription) []publishapi.ServiceAPIDescription { +func join(a, b []publishapi.ServiceAPIDescription) []publishapi.ServiceAPIDescription { var result []publishapi.ServiceAPIDescription if (a == nil) || (b == nil) || (len(a) == 0) || (len(b) == 0) { @@ -110,7 +110,7 @@ func intersection(a, b []publishapi.ServiceAPIDescription) []publishapi.ServiceA for _, itemA := range a { for _, itemB := range b { - if (itemA.ApiId != nil) && (itemB.ApiId != nil) && (*itemA.ApiId == *itemB.ApiId) { + if itemA.ApiName == itemB.ApiName { result = append(result, itemA) break }