Merge "Issue-ID: PORTAL-913 optimization in git clone using --depth"
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / controller / WidgetsCatalogMarkupController.java
index e01c8ee..eba0faf 100644 (file)
@@ -43,7 +43,7 @@ import javax.servlet.http.HttpServletResponse;
 import org.onap.portalapp.controller.EPUnRestrictedBaseController;
 import org.onap.portalapp.portal.domain.WidgetServiceHeaders;
 import org.onap.portalapp.portal.logging.aop.EPAuditLog;
-import org.onap.portalapp.portal.service.ConsulHealthService;
+import org.onap.portalapp.portal.service.WidgetMService;
 import org.onap.portalapp.portal.utils.EcompPortalUtils;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.onap.portalsdk.core.util.SystemProperties;
@@ -51,8 +51,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.client.RestClientException;
 import org.springframework.web.client.RestTemplate;
@@ -69,7 +68,7 @@ public class WidgetsCatalogMarkupController extends EPUnRestrictedBaseController
        private final String whatService = "widgets-service";
 
        @Autowired
-       private ConsulHealthService consulHealthService;
+       private WidgetMService widgetMService;
 
        @Bean
        public CommonsMultipartResolver multipartResolver() {
@@ -89,13 +88,13 @@ public class WidgetsCatalogMarkupController extends EPUnRestrictedBaseController
                });
        }
 
-       @RequestMapping(value = "/portalApi/microservices/markup/{widgetId}", method = RequestMethod.GET)
+       @GetMapping(value = "/portalApi/microservices/markup/{widgetId}")
        public String getWidgetMarkup(HttpServletRequest request, HttpServletResponse response,
                        @PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
                return template
                                .getForObject(
                                                EcompPortalUtils.widgetMsProtocol() + "://"
-                                                               + consulHealthService.getServiceLocation(whatService,
+                                                               + widgetMService.getServiceLocation(whatService,
                                                                                SystemProperties.getProperty("microservices.widget.local.port"))
                                                                + "/widget/microservices/markup/" + widgetId,
                                                String.class, WidgetServiceHeaders.getInstance());