X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=portal-BE%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportal%2FrestTemplates%2FPortalWMSTemplate.java;h=5b99e48a547555ac69492b633758bc5983e851cb;hb=8d84790f07aad48bebcbae1e53d6c7e99e697d5b;hp=74707445342567ad31140307592584e78e07a863;hpb=6aa4d5e4b2792d7cd5037ec8f5a87bfbaa0b1ade;p=portal.git diff --git a/portal-BE/src/main/java/org/onap/portal/restTemplates/PortalWMSTemplate.java b/portal-BE/src/main/java/org/onap/portal/restTemplates/PortalWMSTemplate.java index 74707445..5b99e48a 100644 --- a/portal-BE/src/main/java/org/onap/portal/restTemplates/PortalWMSTemplate.java +++ b/portal-BE/src/main/java/org/onap/portal/restTemplates/PortalWMSTemplate.java @@ -1,10 +1,13 @@ package org.onap.portal.restTemplates; +import java.util.List; +import org.onap.portal.domain.dto.ecomp.WidgetCatalog; import org.onap.portal.domain.dto.ecomp.WidgetServiceHeaders; import org.onap.portal.service.WidgetMService; import org.onap.portal.utils.EcompPortalUtils; import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; @@ -15,7 +18,6 @@ import org.springframework.web.client.RestTemplate; public class PortalWMSTemplate { private final RestTemplate template = new RestTemplate(); - private final WidgetMService widgetMService; @Autowired @@ -33,4 +35,14 @@ public class PortalWMSTemplate { + "/widget/microservices/widgetCatalog/parameters/" + widgetId, HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), Long.class); } + + public ResponseEntity> getWidgets(long serviceId, + ParameterizedTypeReference> typeRef) + throws Exception { + return template.exchange( + EcompPortalUtils.widgetMsProtocol() + "://" + widgetMService + .getServiceLocation("widgets-service", SystemProperties.getProperty("microservices.widget.local.port")) + + "/widget/microservices/widgetCatalog/service/" + serviceId, + HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef); + } }