diff options
author | Rupinder <rupinsi1@in.ibm.com> | 2020-05-05 15:31:50 +0530 |
---|---|---|
committer | Rupinder <rupinsi1@in.ibm.com> | 2020-05-05 15:32:02 +0530 |
commit | 70f0e5bb074f7b64427b830bfea63852573a7c2c (patch) | |
tree | 6532e70cf55aa975f1943de3be96250e8e590154 | |
parent | c2f7d24209a7f9b27b2fdd870539529046ae5c24 (diff) |
added appropriate annotations
Issue-ID: USECASEUI-423
Change-Id: I6860fec8d0b08373a0a2a12d0407dc21eeced2be
Signed-off-by: Rupinder <rupinsi1@in.ibm.com>
2 files changed, 15 insertions, 10 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceInstanceController.java b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceInstanceController.java index 1f6ee7e3..22f8ca61 100644 --- a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceInstanceController.java +++ b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceInstanceController.java @@ -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"); diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceLcmController.java b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceLcmController.java index 2f63425d..f3c16fa9 100644 --- a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceLcmController.java +++ b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceLcmController.java @@ -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); |