From 62a2498304893dd8db50d03f371e3add5514ddfd Mon Sep 17 00:00:00 2001 From: guochuyicmri Date: Mon, 22 Apr 2019 17:17:18 +0800 Subject: Add backend Code for serviceType management UI page Change-Id: Iafb5313dab7ce05037f2342cb5d1fc58c69238ef Issue-ID: USECASEUI-213 Signed-off-by: guochuyicmri --- .../org/onap/usecaseui/server/controller/lcm/CustomerController.java | 4 ++-- .../java/org/onap/usecaseui/server/service/lcm/CustomerService.java | 2 +- .../org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java | 2 +- .../usecaseui/server/service/lcm/impl/DefaultCustomerService.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/CustomerController.java b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/CustomerController.java index 22bda7e4..62c9ed28 100644 --- a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/CustomerController.java +++ b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/CustomerController.java @@ -77,8 +77,8 @@ public class CustomerController { @ResponseBody @RequestMapping(value={"/uui-lcm/customers/{customerId}/service-subscriptions/{serviceType}"},method = RequestMethod.PUT,produces="application/json") - public JSONObject createOrUpdateServiceType(HttpServletRequest request,@PathVariable String serviceType){ - return customerService.createOrUpdateServiceType(request, serviceType); + public JSONObject createOrUpdateServiceType(HttpServletRequest request,@PathVariable String serviceType,@PathVariable String customerId){ + return customerService.createOrUpdateServiceType(request, serviceType,customerId); } @ResponseBody diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/CustomerService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/CustomerService.java index 2e906550..62f8d4a6 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/CustomerService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/CustomerService.java @@ -36,7 +36,7 @@ public interface CustomerService { List listServiceSubscriptions(String customerId); - JSONObject createOrUpdateServiceType(HttpServletRequest request,String serviceType); + JSONObject createOrUpdateServiceType(HttpServletRequest request,String serviceType,String customerId); JSONObject deleteServiceType(String customerId,String serviceType,String resourceVersion); diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java index 58ce2cb5..fce94ba0 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java @@ -132,7 +132,7 @@ public interface AAIService { }) //@GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions") @PUT("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}") - Call createOrUpdateServiceType(@Path("global-customer-id") String customerId,@Path("service-type") String serviceType); + Call createOrUpdateServiceType(@Path("global-customer-id") String customerId,@Path("service-type") String serviceType,@Body RequestBody body); @Headers({ "X-TransactionId: 7777", diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultCustomerService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultCustomerService.java index d75d101a..641aa8c5 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultCustomerService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultCustomerService.java @@ -157,12 +157,12 @@ public class DefaultCustomerService implements CustomerService { } @Override - public JSONObject createOrUpdateServiceType(HttpServletRequest request,String serviceType){ + public JSONObject createOrUpdateServiceType(HttpServletRequest request,String serviceType,String customerId){ JSONObject result = new JSONObject(); try { logger.info("aai createOrUpdateServiceType is starting!"); RequestBody requestBody = extractBody(request); - Response response = this.aaiService.createOrUpdateCustomer(serviceType,requestBody).execute(); + Response response = this.aaiService.createOrUpdateServiceType(customerId,serviceType,requestBody).execute(); logger.info("aai createOrUpdateServiceType is finished!"); if(response.isSuccessful()){ result.put("status", "SUCCESS"); -- cgit 1.2.3-korg