aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxu ran <xuranyjy@chinamobile.com>2020-05-06 03:22:08 +0000
committerGerrit Code Review <gerrit@onap.org>2020-05-06 03:22:08 +0000
commit530fb0b76e88389f012af16af46ad82cb2a132f4 (patch)
treef30622925f1437b02c75ee30787d4f432a7d450e
parente20e1c32dcfc8540a54d7758ba7b83c0e4c8a952 (diff)
parent70f0e5bb074f7b64427b830bfea63852573a7c2c (diff)
Merge "added appropriate annotations"
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceInstanceController.java11
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceLcmController.java14
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);