removed code smells 18/107418/4
authorRupinder <rupinsi1@in.ibm.com>
Sat, 9 May 2020 10:54:07 +0000 (16:24 +0530)
committerRupinderjeet Singh <rupinsi1@in.ibm.com>
Mon, 11 May 2020 04:47:32 +0000 (04:47 +0000)
Issue-ID: PORTAL-865
Change-Id: I1fb4a87b6cb4a4b7360e761918473ebf80622325
Signed-off-by: Rupinder <rupinsi1@in.ibm.com>
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/FunctionalMenuController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/GetAccessController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/HealthCheckController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ManifestController.java

index bc2c19b..d43d9f3 100644 (file)
@@ -86,9 +86,6 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 
index 65abc28..3233a5f 100644 (file)
@@ -83,12 +83,10 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
index d8bf7dd..19441ac 100644 (file)
@@ -47,6 +47,7 @@ import javax.servlet.http.HttpServletRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 import org.onap.portalapp.controller.EPUnRestrictedBaseController;
@@ -78,7 +79,7 @@ public class GetAccessController extends EPUnRestrictedBaseController {
                }
        };
        
-       @RequestMapping(value = { "/portalApi/getAppList" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/portalApi/getAppList" }, produces = "application/json")
        public List<GetAccessResult> getAppList(HttpServletRequest request) throws IOException {
                List<GetAccessResult> appsList = null;
                EPUser user = EPUserUtils.getUserSession(request);
index ca66809..6900c9d 100644 (file)
@@ -46,6 +46,7 @@ import javax.servlet.http.HttpServletResponse;
 import org.slf4j.MDC;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 import org.onap.music.main.MusicUtil;
@@ -118,7 +119,7 @@ public class HealthCheckController extends EPUnRestrictedBaseController {
        private final String statusDown = "DOWN";
        private final String statusOk = "OK";
 
-       @RequestMapping(value = { "/portalApi/healthCheck" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/portalApi/healthCheck" }, produces = "application/json")
        public HealthStatus healthCheck(HttpServletRequest request, HttpServletResponse response) {
                HealthStatus healthStatus = new HealthStatus(500, "");
 
@@ -229,8 +230,8 @@ public class HealthCheckController extends EPUnRestrictedBaseController {
                return healthStatus;
        }
 
-       @RequestMapping(value = {
-                       "/portalApi/healthCheckSuspend" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = {
+                       "/portalApi/healthCheckSuspend" }, produces = "application/json")
        public HealthStatus healthCheckSuspend(HttpServletRequest request, HttpServletResponse response) {
                HealthStatus healthStatus = new HealthStatus(500, "Suspended for manual failover mechanism");
 
@@ -243,8 +244,8 @@ public class HealthCheckController extends EPUnRestrictedBaseController {
                return healthStatus;
        }
 
-       @RequestMapping(value = {
-                       "/portalApi/healthCheckResume" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = {
+                       "/portalApi/healthCheckResume" }, produces = "application/json")
        public HealthStatus healthCheckResume(HttpServletRequest request, HttpServletResponse response) {
                HealthStatus healthStatus = new HealthStatus(500, "Resumed from manual failover mechanism");
 
@@ -255,7 +256,7 @@ public class HealthCheckController extends EPUnRestrictedBaseController {
                return healthStatus;
        }
 
-       @RequestMapping(value = { "/portalApi/ping" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/portalApi/ping" }, produces = "application/json")
        public HealthStatus ping(HttpServletRequest request, HttpServletResponse response) {
                HealthStatus healthStatus = new HealthStatus(200, "OK");
                EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/ping", "GET result =", response.getStatus());
index 508b1be..5ee5958 100644 (file)
@@ -22,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 import com.alibaba.fastjson.JSONObject;
@@ -33,19 +35,19 @@ public class LanguageController {
     @Autowired
     private LanguageService languageService;
 
-    @RequestMapping(value = "/language",method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
+    @GetMapping(value = "/language", produces = "application/json;charset=UTF-8")
     public JSONObject getLanguageList() {
         return languageService.getLanguages();
     }
 
-    @RequestMapping(value = "/languageSetting/user/{loginId}",method = RequestMethod.POST)
+    @PostMapping(value = "/languageSetting/user/{loginId}")
     public void setUpUserLanguage(@RequestBody JSONObject jsonLanguageId,
                                   @PathVariable("loginId") String loginId) throws Exception {
         Integer languageId = jsonLanguageId.getInteger("languageId");
         languageService.setUpUserLanguage(languageId,loginId);
     }
 
-    @RequestMapping(value = "/languageSetting/user/{loginId}",method = RequestMethod.GET)
+    @GetMapping(value = "/languageSetting/user/{loginId}")
     public JSONObject getUserLanguage(HttpServletRequest request, HttpServletResponse response,
                                       @PathVariable("loginId") String loginId) {
         return languageService.getUserLanguage(loginId);
index 471ebe5..747b3da 100644 (file)
@@ -47,6 +47,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.web.bind.annotation.RequestMapping;
+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;
@@ -91,7 +92,7 @@ public class ManifestController extends RestrictedBaseController {
         * { "error": "message" }
         *         </pre>
         */
-       @RequestMapping(value = { "/portalApi/manifest" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/portalApi/manifest" }, produces = "application/json")
        @ResponseBody
        public Map<String, Object> getManifest(HttpServletRequest request) {
                Map<String, Object> response = new HashMap<String, Object>();