added appropriate annotations 95/107095/1
authorRupinder <rupinsi1@in.ibm.com>
Tue, 5 May 2020 10:01:50 +0000 (15:31 +0530)
committerRupinder <rupinsi1@in.ibm.com>
Tue, 5 May 2020 10:02:02 +0000 (15:32 +0530)
Issue-ID: USECASEUI-423
Change-Id: I6860fec8d0b08373a0a2a12d0407dc21eeced2be
Signed-off-by: Rupinder <rupinsi1@in.ibm.com>
server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceInstanceController.java
server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceLcmController.java

index 1f6ee7e..22f8ca6 100644 (file)
@@ -31,6 +31,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.stereotype.Controller;
 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;
 
@@ -61,7 +62,7 @@ public class ServiceInstanceController {
     }
 
        @ResponseBody
-    @RequestMapping(value = {"/uui-lcm/service-instances"}, method = RequestMethod.GET , produces = "application/json")
+    @GetMapping(value = {"/uui-lcm/service-instances"}, produces = "application/json")
     public String listServiceInstances(HttpServletRequest request) throws JsonProcessingException{
                ObjectMapper mapper = new ObjectMapper();
         String customerId = request.getParameter("customerId");
@@ -76,7 +77,7 @@ public class ServiceInstanceController {
     }
        
        @ResponseBody
-    @RequestMapping(value = {"/uui-lcm/service-ns-instances"}, method = RequestMethod.GET , produces = "application/json")
+    @GetMapping(value = {"/uui-lcm/service-ns-instances"}, produces = "application/json")
     public String listNsOrServiceInstances(HttpServletRequest request) throws JsonProcessingException{
                ObjectMapper mapper = new ObjectMapper();
         String customerId = request.getParameter("customerId");
@@ -95,19 +96,19 @@ public class ServiceInstanceController {
     }
        
        @ResponseBody
-    @RequestMapping(value = {"/uui-lcm/serviceNumByCustomer"}, method = RequestMethod.GET , produces = "application/json")
+    @GetMapping(value = {"/uui-lcm/serviceNumByCustomer"}, produces = "application/json")
     public String serviceNumByCustomer(HttpServletRequest request) throws JsonProcessingException{
                return serviceInstanceService.serviceNumByCustomer();
        }
        
        @ResponseBody
-    @RequestMapping(value = {"/uui-lcm/serviceNumByServiceType/{customerId}"}, method = RequestMethod.GET , produces = "application/json")
+    @GetMapping(value = {"/uui-lcm/serviceNumByServiceType/{customerId}"}, produces = "application/json")
     public String serviceNumByServiceType(@PathVariable String customerId) throws JsonProcessingException{
                return serviceInstanceService.serviceNumByServiceType(customerId);
        }
        
     @ResponseBody
-    @RequestMapping(value = {"/uui-lcm/getServiceInstanceById"}, method = RequestMethod.GET , produces = "application/json")
+    @GetMapping(value = {"/uui-lcm/getServiceInstanceById"}, produces = "application/json")
     public String getServiceInstanceById(HttpServletRequest request){
         String customerId = request.getParameter("customerId");
         String serviceType = request.getParameter("serviceType");
index 2f63425..f3c16fa 100644 (file)
@@ -32,6 +32,10 @@ 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.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;
 
@@ -56,7 +60,7 @@ public class ServiceLcmController {
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/uui-lcm/services"}, method = RequestMethod.POST , produces = "application/json")
+    @PostMapping(value = {"/uui-lcm/services"}, produces = "application/json")
     public ServiceOperation instantiateService(HttpServletRequest request) throws ParseException{
        String customerId = request.getParameter("customerId");
        String serviceType = request.getParameter("serviceType");
@@ -75,7 +79,7 @@ public class ServiceLcmController {
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/uui-lcm/services/{serviceId}/operations/{operationId}"}, method = RequestMethod.GET , produces = "application/json")
+    @GetMapping(value = {"/uui-lcm/services/{serviceId}/operations/{operationId}"}, produces = "application/json")
     public OperationProgressInformation queryOperationProgress(HttpServletRequest request,@PathVariable(value="serviceId") String serviceId, @PathVariable(value="operationId") String operationId){
        String operationType = request.getParameter("operationType");
        String operationResult = CommonConstant.IN_PROGRESS_CODE;
@@ -99,7 +103,7 @@ public class ServiceLcmController {
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/uui-lcm/services/{serviceId}"}, method = RequestMethod.DELETE , produces = "application/json")
+    @DeleteMapping(value = {"/uui-lcm/services/{serviceId}"}, produces = "application/json")
     public DeleteOperationRsp terminateService(@PathVariable(value = "serviceId") String serviceId, HttpServletRequest request) throws ParseException{
        DeleteOperationRsp deleteOperationRsp = serviceLcmService.terminateService(serviceId, request);
        ServiceInstanceOperations serviceOpera = new ServiceInstanceOperations(serviceId,deleteOperationRsp.getOperationId(), CommonConstant.DELETING_CODE,"0", CommonConstant.IN_PROGRESS_CODE,DateUtils.dateToString(DateUtils.now()),null);
@@ -121,7 +125,7 @@ public class ServiceLcmController {
      * @throws ParseException 
      */
     @ResponseBody
-    @RequestMapping(value = {"/uui-lcm/services/scaleServices/{serviceId}"}, method = RequestMethod.POST , produces = "application/json")
+    @PostMapping(value = {"/uui-lcm/services/scaleServices/{serviceId}"}, produces = "application/json")
     public SaveOrUpdateOperationRsp scaleServices(@PathVariable(value = "serviceId") String serviceId, HttpServletRequest request) throws ParseException{
        SaveOrUpdateOperationRsp saveOrUpdateOperationRsp =serviceLcmService.scaleService(serviceId, request);
        ServiceInstanceOperations serviceOpera = new ServiceInstanceOperations(serviceId,saveOrUpdateOperationRsp.getOperationId(), CommonConstant.SCALING_CODE,"0", CommonConstant.IN_PROGRESS_CODE,DateUtils.dateToString(DateUtils.now()),null);
@@ -143,7 +147,7 @@ public class ServiceLcmController {
      * @throws ParseException 
      */
     @ResponseBody
-    @RequestMapping(value = {"/uui-lcm/services/updateService/{serviceId}"}, method = RequestMethod.PUT , produces = "application/json")
+    @PutMapping(value = {"/uui-lcm/services/updateService/{serviceId}"}, produces = "application/json")
     public SaveOrUpdateOperationRsp updateServices(@PathVariable(value = "serviceId") String serviceId, HttpServletRequest request) throws ParseException{
        SaveOrUpdateOperationRsp saveOrUpdateOperationRsp =serviceLcmService.scaleService(serviceId, request);
        ServiceInstanceOperations serviceOpera = new ServiceInstanceOperations(serviceId,saveOrUpdateOperationRsp.getOperationId(), CommonConstant.UPDATING_CODE,"0", CommonConstant.IN_PROGRESS_CODE,DateUtils.dateToString(DateUtils.now()),null);