Add backend Code for serviceType management UI page 94/85994/2
authorguochuyicmri <guochuyi@chinamobile.com>
Mon, 22 Apr 2019 09:17:18 +0000 (17:17 +0800)
committerguochuyicmri <guochuyi@chinamobile.com>
Tue, 23 Apr 2019 02:50:17 +0000 (10:50 +0800)
Change-Id: Iafb5313dab7ce05037f2342cb5d1fc58c69238ef
Issue-ID: USECASEUI-213
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
server/src/main/java/org/onap/usecaseui/server/controller/lcm/CustomerController.java
server/src/main/java/org/onap/usecaseui/server/service/lcm/CustomerService.java
server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java
server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultCustomerService.java

index 22bda7e..62c9ed2 100644 (file)
@@ -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
index 2e90655..62f8d4a 100644 (file)
@@ -36,7 +36,7 @@ public interface CustomerService {
     
     List<AAIServiceSubscription> 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);
     
index 58ce2cb..fce94ba 100644 (file)
@@ -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<ResponseBody> createOrUpdateServiceType(@Path("global-customer-id") String customerId,@Path("service-type") String serviceType);
+       Call<ResponseBody> createOrUpdateServiceType(@Path("global-customer-id") String customerId,@Path("service-type") String serviceType,@Body RequestBody body);
     
     @Headers({
         "X-TransactionId: 7777",
index d75d101..641aa8c 100644 (file)
@@ -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<ResponseBody> response = this.aaiService.createOrUpdateCustomer(serviceType,requestBody).execute();
+                       Response<ResponseBody> response = this.aaiService.createOrUpdateServiceType(customerId,serviceType,requestBody).execute();
                        logger.info("aai createOrUpdateServiceType is finished!");
                        if(response.isSuccessful()){
                                result.put("status", "SUCCESS");