lower code smells
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / controller / WebAnalyticsExtAppController.java
index 92449a3..a8eb1d6 100644 (file)
@@ -4,6 +4,8 @@
  * ===================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  * ===================================================================
+ * Modifications Copyright (c) 2020 IBM
+ * ===================================================================
  *
  * Unless otherwise specified, all software contained herein is licensed
  * under the Apache License, Version 2.0 (the "License");
@@ -77,6 +79,8 @@ import org.springframework.util.concurrent.ListenableFuture;
 import org.springframework.util.concurrent.SuccessCallback;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
@@ -117,7 +121,7 @@ public class WebAnalyticsExtAppController extends EPRestrictedRESTfulBaseControl
         * @return String
         */
        @ApiOperation(value = "Gets javascript with functions that support gathering and reporting web analytics.", response = String.class)
-       @RequestMapping(value = { "/analytics" }, method = RequestMethod.GET, produces = "application/javascript")
+       @GetMapping(value = { "/analytics" }, produces = "application/javascript")
        public String getAnalyticsScript(HttpServletRequest request) {
                String responseText = "";
                EPApp app = null;
@@ -162,7 +166,7 @@ public class WebAnalyticsExtAppController extends EPRestrictedRESTfulBaseControl
         *            Analytics
         * @return PortalAPIResponse
         */
-       @RequestMapping(value = { "/storeAnalytics" }, method = RequestMethod.POST, produces = "application/json")
+       @PostMapping(value = { "/storeAnalytics" }, produces = "application/json")
        @ResponseBody
        @ApiOperation(value = "Accepts data from partner applications with web analytics data.", response = PortalAPIResponse.class)
        public PortalAPIResponse storeAnalyticsScript(HttpServletRequest request, @RequestBody Analytics analyticsMap) {