replaced the annotations 02/107202/1
authorRupinder <rupinsi1@in.ibm.com>
Wed, 6 May 2020 09:21:43 +0000 (14:51 +0530)
committerRupinder <rupinsi1@in.ibm.com>
Wed, 6 May 2020 09:22:26 +0000 (14:52 +0530)
Issue-ID: USECASEUI-423
Change-Id: I0b38f2e8d9dac7d1fb0e3e0058a5840f69592987
Signed-off-by: Rupinder <rupinsi1@in.ibm.com>
server/src/main/java/org/onap/usecaseui/server/controller/nsmf/TaskMgtController.java
server/src/main/java/org/onap/usecaseui/server/controller/sotn/SotnController.java

index 07c2cad..71a6653 100644 (file)
@@ -25,6 +25,8 @@ 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.GetMapping;
+import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
 
@@ -43,41 +45,41 @@ public class TaskMgtController {
     }
 
     @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 querySlicingTask(@PathVariable int pageNo, @PathVariable int pageSize) {
         return taskMgtService.querySlicingTask(pageNo, pageSize);
     }
 
     @ResponseBody
-    @RequestMapping(value = {
-        "/{processingStatus}/business/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {
+        "/{processingStatus}/business/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json")
     public ServiceResult querySlicingTaskByStatus(@PathVariable String processingStatus, @PathVariable int pageNo,
         @PathVariable int pageSize) {
         return taskMgtService.querySlicingTaskByStatus(processingStatus, pageNo, pageSize);
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/{taskId}/auditInfo"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {"/{taskId}/auditInfo"}, produces = "application/json")
     public ServiceResult queryTaskAuditInfo(@PathVariable String taskId) {
         return taskMgtService.queryTaskAuditInfo(taskId);
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/auditInfo"}, method = RequestMethod.PUT, produces = "application/json")
+    @PutMapping(value = {"/auditInfo"}, produces = "application/json")
     public ServiceResult updateTaskAuditInfo(@RequestBody SlicingTaskAuditInfo slicingTaskAuditInfo) {
         return taskMgtService.updateTaskAuditInfo(slicingTaskAuditInfo);
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/{taskId}/taskCreationInfo"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {"/{taskId}/taskCreationInfo"}, produces = "application/json")
     public ServiceResult queryTaskCreationInfo(@PathVariable String taskId) {
         return taskMgtService.queryTaskCreationInfo(taskId);
     }
 
     @ResponseBody
-    @RequestMapping(value = {
-        "/{taskId}/taskCreationProgress"}, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = {
+        "/{taskId}/taskCreationProgress"}, produces = "application/json")
     public ServiceResult queryTaskCreationProgress(@PathVariable String taskId) {
         return taskMgtService.queryTaskCreationProgress(taskId);
     }
index 5b84d8c..3cff1ef 100644 (file)
@@ -31,6 +31,9 @@ import org.onap.usecaseui.server.util.UuiCommonUtil;
 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.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
@@ -54,7 +57,7 @@ public class SotnController {
                this.sotnService = sotnService;
        }
        
-    @RequestMapping(value = {"/getNetWorkResources"}, method = RequestMethod.GET)
+    @GetMapping(value = {"/getNetWorkResources"})
        public List<NetWorkResource> getNetWorkResources(){
        List<NetWorkResource> result = new ArrayList<NetWorkResource>();
        String json  = sotnService.getNetWorkResources();
@@ -74,62 +77,62 @@ public class SotnController {
                return result;
        }
     
-    @RequestMapping(value = {"/getPinterfaceByPnfName/{pnfName:.+}"}, method = RequestMethod.GET)
+    @GetMapping(value = {"/getPinterfaceByPnfName/{pnfName:.+}"})
     public List<Pinterface>  getPinterfaceByPnfName(@PathVariable(value="pnfName") String pnfName){
        return sotnService.getPinterfaceByPnfName(pnfName);
     }
     
-    @RequestMapping(value = {"/getLogicalLinks"}, method = RequestMethod.GET)
+    @GetMapping(value = {"/getLogicalLinks"})
     public String getLogicalLinks(){
        return sotnService.getLogicalLinks();
     }
     
-    @RequestMapping(value = {"/getSpecificLogicalLink/{linkName:.+}"}, method = RequestMethod.GET)
+    @GetMapping(value = {"/getSpecificLogicalLink/{linkName:.+}"})
     public String getSpecificLogicalLink(@PathVariable(value="linkName") String linkName){
        return sotnService.getSpecificLogicalLink(linkName);
     }
     
-    @RequestMapping(value = {"/getHostUrl/{aaiId:.+}"}, method = RequestMethod.GET)
+    @GetMapping(value = {"/getHostUrl/{aaiId:.+}"})
     public String getHostUrl(@PathVariable(value="aaiId") String aaiId){
        return sotnService.getHostUrl(aaiId);
     }
     
-    @RequestMapping(value = {"/getExtAaiId/{aaiId:.+}"}, method = RequestMethod.GET)
+    @GetMapping(value = {"/getExtAaiId/{aaiId:.+}"})
     public String getExtAaiId(@PathVariable(value="aaiId") String aaiId){
        return sotnService.getExtAaiId(aaiId);
     }
     
-    @RequestMapping(value = {"/createHostUrl/{aaiId:.+}"}, method = RequestMethod.PUT)
+    @PutMapping(value = {"/createHostUrl/{aaiId:.+}"})
     public String createHostUrl(HttpServletRequest request,@PathVariable(value="aaiId") String aaiId){
        return sotnService.createHostUrl(request, aaiId);
     }
     
-    @RequestMapping(value = {"/createTopoNetwork/{networkId:.+}"}, method = RequestMethod.PUT)
+    @PutMapping(value = {"/createTopoNetwork/{networkId:.+}"})
     public String createTopoNetwork(HttpServletRequest request,@PathVariable(value="networkId") String networkId){
        return sotnService.createTopoNetwork(request,networkId);
     }
     
-    @RequestMapping(value = {"/pnf/{pnfName:.+}/p-interfaces/p-interface/{tp-id:.+}/createTerminationPoint"}, method = RequestMethod.PUT)
+    @PutMapping(value = {"/pnf/{pnfName:.+}/p-interfaces/p-interface/{tp-id:.+}/createTerminationPoint"})
     public String createTerminationPoint(HttpServletRequest request,@PathVariable(value="pnfName") String pnfName,@PathVariable(value="tp-id") String tpId){
        return sotnService.createTerminationPoint(request,pnfName,tpId);
     }
     
-    @RequestMapping(value = {"/createLink/{linkName:.+}"}, method = RequestMethod.PUT)
+    @PutMapping(value = {"/createLink/{linkName:.+}"})
     public String createLink(HttpServletRequest request,@PathVariable(value="linkName") String linkName){
        return sotnService.createLink(request, linkName);
     }
     
-    @RequestMapping(value = {"/createPnf/{pnfName:.+}"}, method = RequestMethod.PUT)
+    @PutMapping(value = {"/createPnf/{pnfName:.+}"})
     public String createPnf(HttpServletRequest request,@PathVariable(value="pnfName") String pnfName){
        return sotnService.createPnf(request, pnfName);
     }
     
-    @RequestMapping(value = {"/deleteLink/{linkName:.+}/{resourceVersion:.+}"}, method = RequestMethod.DELETE)
+    @DeleteMapping(value = {"/deleteLink/{linkName:.+}/{resourceVersion:.+}"})
     public String deleteLink(@PathVariable(value="linkName") String linkName,@PathVariable(value="resourceVersion") String resourceVersion){
        return sotnService.deleteLink(linkName,resourceVersion);
     }
     
-    @RequestMapping(value = {"/getServiceInstanceInfo"}, method = RequestMethod.GET)
+    @GetMapping(value = {"/getServiceInstanceInfo"})
     public String getServiceInstanceInfo(HttpServletRequest request){
         String customerId = request.getParameter("customerId");
         String serviceType = request.getParameter("serviceType");
@@ -137,12 +140,12 @@ public class SotnController {
        return sotnService.serviceInstanceInfo(customerId, serviceType, serviceId);
     }
     
-    @RequestMapping(value = {"/getPnfInfo/{pnfName:.+}"}, method = RequestMethod.GET)
+    @GetMapping(value = {"/getPnfInfo/{pnfName:.+}"})
     public String getPnfInfo(@PathVariable(value="pnfName") String pnfName){
        return sotnService.getPnfInfo(pnfName);
     }
     
-    @RequestMapping(value = {"/getAllottedResources"}, method = RequestMethod.GET)
+    @GetMapping(value = {"/getAllottedResources"})
     public String getAllottedResources(HttpServletRequest request){
         String customerId = request.getParameter("customerId");
         String serviceType = request.getParameter("serviceType");
@@ -150,24 +153,24 @@ public class SotnController {
        return sotnService.getAllottedResources(customerId, serviceType,serviceId);
     }
     
-    @RequestMapping(value = {"/getConnectivityInfo/{connectivityId:.+}"}, method = RequestMethod.GET)
+    @GetMapping(value = {"/getConnectivityInfo/{connectivityId:.+}"})
     public String getConnectivityInfo(@PathVariable(value="connectivityId") String connectivityId){
        return sotnService.getConnectivityInfo(connectivityId);
     }
     
-    @RequestMapping(value = {"/getPinterfaceByVpnId/{vpnId:.+}"}, method = RequestMethod.GET)
+    @GetMapping(value = {"/getPinterfaceByVpnId/{vpnId:.+}"})
     public String getPinterfaceByVpnId(@PathVariable(value="vpnId") String vpnId){
        return sotnService.getPinterfaceByVpnId(vpnId);
     }
     
-    @RequestMapping(value = {"/getServiceInstanceList"}, method = RequestMethod.GET)
+    @GetMapping(value = {"/getServiceInstanceList"})
     public String getServiceInstanceList(HttpServletRequest request){
         String customerId = request.getParameter("customerId");
         String serviceType = request.getParameter("serviceType");
        return sotnService.getServiceInstances(customerId, serviceType);
     }
 
-    @RequestMapping(value = {"/deleteExtNetWork"}, method = RequestMethod.DELETE)
+    @DeleteMapping(value = {"/deleteExtNetWork"})
     public String deleteExtNetwork(@RequestParam String extNetworkId,@RequestParam(value="resourceVersion") String resourceVersion){
        return sotnService.deleteExtNetwork(extNetworkId,resourceVersion);
     }