lowered code smells 96/107096/1
authorRupinder <rupinsi1@in.ibm.com>
Tue, 5 May 2020 10:12:58 +0000 (15:42 +0530)
committerRupinder <rupinsi1@in.ibm.com>
Tue, 5 May 2020 10:13:06 +0000 (15:43 +0530)
Issue-ID: USECASEUI-423
Change-Id: I1ff15c32358b0d6e774d974f3f89480ec5b6dc88
Signed-off-by: Rupinder <rupinsi1@in.ibm.com>
server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceQryController.java
server/src/main/java/org/onap/usecaseui/server/controller/nsmf/ResourceMgtController.java
server/src/main/java/org/onap/usecaseui/server/controller/nsmf/ResourceMonitorController.java

index 677e655..9c68a65 100644 (file)
@@ -24,6 +24,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.bind.annotation.PathVariable;
 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;
 
@@ -50,7 +51,7 @@ public class SotnServiceQryController {
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/uui-lcm/Sotnservices/ServiceInstances/{serviceType}"}, method = RequestMethod.GET , produces = "application/json")
+    @GetMapping(value = {"/uui-lcm/Sotnservices/ServiceInstances/{serviceType}"}, produces = "application/json")
     public String getSotnServiceInstances(@PathVariable(value="serviceType") String serviceType){
         System.out.println("Get Service Instance called.");
         String response = sotnServiceQryService.getServiceInstances(serviceType);
@@ -58,7 +59,7 @@ public class SotnServiceQryController {
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/uui-lcm/customers/service-subscriptions"}, method = RequestMethod.GET , produces = "application/json")
+    @GetMapping(value = {"/uui-lcm/customers/service-subscriptions"}, produces = "application/json")
     public String getServiceSubscriptions(){
         System.out.println("Get Service Subscription called.");
         String response = ccvpnCustomerService.querySubscriptionType();
index 40adc9c..4187fc1 100644 (file)
@@ -23,6 +23,9 @@ import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+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;
 
@@ -41,103 +44,103 @@ public class ResourceMgtController {
     }
 
     @ResponseBody
-    @RequestMapping(value = {
-        "/business/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {
+        "/business/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json")
     public ServiceResult querySlicingBusiness(@PathVariable int pageNo, @PathVariable int pageSize) {
         return resourceMgtService.querySlicingBusiness(pageNo, pageSize);
     }
 
     @ResponseBody
-    @RequestMapping(value = {
-        "/{businessStatus}/business/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {
+        "/{businessStatus}/business/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json")
     public ServiceResult querySlicingBusinessByStatus(@PathVariable String businessStatus, @PathVariable int pageNo,
         @PathVariable int pageSize) {
         return resourceMgtService.querySlicingBusinessByStatus(businessStatus, pageNo, pageSize);
     }
 
     @ResponseBody
-    @RequestMapping(value = {
-        "/business/{businessId}/details"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {
+        "/business/{businessId}/details"}, produces = "application/json")
     public ServiceResult querySlicingBusinessDetails(@PathVariable String businessId) {
         return resourceMgtService.querySlicingBusinessDetails(businessId);
     }
 
     @ResponseBody
-    @RequestMapping(value = {
-        "/nsi/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {
+        "/nsi/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json")
     public ServiceResult queryNsiInstances(@PathVariable int pageNo, @PathVariable int pageSize) {
         return resourceMgtService.queryNsiInstances(pageNo, pageSize);
     }
 
     @ResponseBody
-    @RequestMapping(value = {
-        "/nsi/{instanceStatus}/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {
+        "/nsi/{instanceStatus}/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json")
     public ServiceResult queryNsiInstancesByStatus(@PathVariable String instanceStatus, @PathVariable int pageNo,
         @PathVariable int pageSize) {
         return resourceMgtService.queryNsiInstancesByStatus(instanceStatus, pageNo, pageSize);
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/nsi/{nsiId}/details"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {"/nsi/{nsiId}/details"}, produces = "application/json")
     public ServiceResult queryNsiDetails(@PathVariable String nsiId) {
         return resourceMgtService.queryNsiDetails(nsiId);
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/nsi/{nsiId}/nssiInstances"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {"/nsi/{nsiId}/nssiInstances"}, produces = "application/json")
     public ServiceResult queryNsiRelatedNssiInfo(@PathVariable String nsiId) {
         return resourceMgtService.queryNsiRelatedNssiInfo(nsiId);
     }
 
     @ResponseBody
-    @RequestMapping(value = {
-        "/nssi/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {
+        "/nssi/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json")
     public ServiceResult queryNssiInstances(@PathVariable int pageNo, @PathVariable int pageSize) {
         return resourceMgtService.queryNssiInstances(pageNo, pageSize);
     }
 
     @ResponseBody
-    @RequestMapping(value = {
-        "/nssi/instanceStatus/{instanceStatus}/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {
+        "/nssi/instanceStatus/{instanceStatus}/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json")
     public ServiceResult queryNssiInstancesByStatus(@PathVariable String instanceStatus, @PathVariable int pageNo,
         @PathVariable int pageSize) {
         return resourceMgtService.queryNssiInstancesByStatus(instanceStatus, pageNo, pageSize);
     }
 
     @ResponseBody
-    @RequestMapping(value = {
-        "/nssi/environmentContext/{environmentContext}/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {
+        "/nssi/environmentContext/{environmentContext}/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json")
     public ServiceResult queryNssiInstancesByEnvironment(@PathVariable String environmentContext,
         @PathVariable int pageNo, @PathVariable int pageSize) {
         return resourceMgtService.queryNssiInstancesByEnvironment(environmentContext, pageNo, pageSize);
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/nssi/{nssiId}/details"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {"/nssi/{nssiId}/details"}, produces = "application/json")
     public ServiceResult queryNssiDetails(@PathVariable String nssiId) {
         return resourceMgtService.queryNssiDetails(nssiId);
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/{serviceId}/activate"}, method = RequestMethod.PUT, produces = "application/json")
+    @PutMapping(value = {"/{serviceId}/activate"}, produces = "application/json")
     public ServiceResult activateSlicingService(@PathVariable(value = "serviceId") String serviceId) {
         return resourceMgtService.activateSlicingService(serviceId);
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/{serviceId}/deactivate"}, method = RequestMethod.PUT, produces = "application/json")
+    @PutMapping(value = {"/{serviceId}/deactivate"}, produces = "application/json")
     public ServiceResult deactivateSlicingService(@PathVariable(value = "serviceId") String serviceId) {
         return resourceMgtService.deactivateSlicingService(serviceId);
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/{serviceId}"}, method = RequestMethod.DELETE, produces = "application/json")
+    @DeleteMapping(value = {"/{serviceId}"}, produces = "application/json")
     public ServiceResult terminateSlicingService(@PathVariable(value = "serviceId") String serviceId) {
         return resourceMgtService.terminateSlicingService(serviceId);
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/{serviceId}/progress"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {"/{serviceId}/progress"}, produces = "application/json")
     public ServiceResult queryOperationProgress(@PathVariable(value = "serviceId") String serviceId) {
         return resourceMgtService.queryOperationProgress(serviceId);
     }
index 3431412..24ef506 100644 (file)
@@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.CrossOrigin;
 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.PostMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
 
@@ -43,8 +44,8 @@ public class ResourceMonitorController {
     }
 
     @ResponseBody
-    @RequestMapping(value = {
-        "/queryTimestamp/{queryTimestamp}/trafficData"}, method = RequestMethod.POST, produces = "application/json")
+    @PostMapping(value = {
+        "/queryTimestamp/{queryTimestamp}/trafficData"}, produces = "application/json")
     public ServiceResult querySlicingUsageTraffic(@PathVariable(value = "queryTimestamp") String queryTimestamp,
         @RequestBody
             ServiceList serviceList) {
@@ -52,8 +53,8 @@ public class ResourceMonitorController {
     }
 
     @ResponseBody
-    @RequestMapping(value = {
-        "/queryTimestamp/{queryTimestamp}/onlineUsers"}, method = RequestMethod.POST, produces = "application/json")
+    @PostMapping(value = {
+        "/queryTimestamp/{queryTimestamp}/onlineUsers"}, produces = "application/json")
     public ServiceResult querySlicingOnlineUserNumber(@PathVariable(value = "queryTimestamp") String queryTimestamp,
         @RequestBody
             ServiceList serviceList) {
@@ -61,8 +62,8 @@ public class ResourceMonitorController {
     }
 
     @ResponseBody
-    @RequestMapping(value = {
-        "/queryTimestamp/{queryTimestamp}/bandwidth"}, method = RequestMethod.POST, produces = "application/json")
+    @PostMapping(value = {
+        "/queryTimestamp/{queryTimestamp}/bandwidth"}, produces = "application/json")
     public ServiceResult querySlicingTotalBandwidth(@PathVariable(value = "queryTimestamp") String queryTimestamp,
         @RequestBody
             ServiceList serviceList) {