Code Review
/
nonrtric
/
plt
/
sme.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
NONRTRIC-946: Capifcore - join on ApiName
[nonrtric/plt/sme.git]
/
capifcore
/
internal
/
publishservice
/
publishservice.go
diff --git
a/capifcore/internal/publishservice/publishservice.go
b/capifcore/internal/publishservice/publishservice.go
index
670d2ed
..
09c4ef7
100644
(file)
--- 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()
func (ps *PublishService) GetAllowedPublishedServices(apiListRequestedServices []publishapi.ServiceAPIDescription) []publishapi.ServiceAPIDescription {
apiListAllPublished := ps.GetAllPublishedServices()
- allowedPublishedServices :=
intersectio
n(apiListAllPublished, apiListRequestedServices)
+ allowedPublishedServices :=
joi
n(apiListAllPublished, apiListRequestedServices)
return allowedPublishedServices
}
return allowedPublishedServices
}
-func
intersectio
n(a, b []publishapi.ServiceAPIDescription) []publishapi.ServiceAPIDescription {
+func
joi
n(a, b []publishapi.ServiceAPIDescription) []publishapi.ServiceAPIDescription {
var result []publishapi.ServiceAPIDescription
if (a == nil) || (b == nil) || (len(a) == 0) || (len(b) == 0) {
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 {
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
}
result = append(result, itemA)
break
}