feat:customer page api sort out add notes 95/94195/1
authorcyuamber <xuranyjy@chinamobile.com>
Fri, 23 Aug 2019 09:55:34 +0000 (17:55 +0800)
committercyuamber <xuranyjy@chinamobile.com>
Fri, 23 Aug 2019 09:55:37 +0000 (17:55 +0800)
Change-Id: I3b2e4b9744d3b7577cc38d63e666be004a0f0d17
Issue-ID: USECASEUI-307
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
usecaseui-portal/src/app/core/services/managemencs.service.ts

index a28885d..da43b8f 100644 (file)
@@ -10,32 +10,46 @@ export class ManagemencsService {
     constructor(private http: HttpClient) { }
     baseUrl = baseUrl.baseUrl;
 
-
-
-
     /* line up */
     url = {
+        // The following APIs are optimizable
         customers: this.baseUrl + "/uui-lcm/customers", /* get */
-        serviceType: this.baseUrl + "/uui-lcm/customers/" + "*_*" + "/service-subscriptions", /* get */
         CustomersPir: this.baseUrl + "/uui-lcm/serviceNumByCustomer", /* get */
+        deleteCustomer: this.baseUrl + "/uui-lcm/customers?customerId=*_*&resourceVersion=*+*", /* delete */
+        // The following APIs are not optimizable
+        serviceType: this.baseUrl + "/uui-lcm/customers/" + "*_*" + "/service-subscriptions", /* get */
         CustomersColumn: this.baseUrl + "/uui-lcm/serviceNumByServiceType/" + "*_*", /* get */
         createCustomer: this.baseUrl + "/uui-lcm/customers/", /* put */
         createServiceType: this.baseUrl + "/uui-lcm/customers/*_*/service-subscriptions/*+*", /* put */
         getCustomerresourceVersion: this.baseUrl + "/uui-lcm/customers/*_*", /* put */
-        deleteCustomer: this.baseUrl + "/uui-lcm/customers?customerId=*_*&resourceVersion=*+*",
         getServiceTypeResourceVersion: this.baseUrl + "/uui-lcm/customers/*_*/service-subscriptions/*+*",
         deleteServiceType: this.baseUrl + "/uui-lcm/customers/*_*/service-subscriptions/*+*?resourceVersion=*@*  ",
     };
 
+    //The following APIs are optimizable ----------------------------------
 
     // Get all customers
     getAllCustomers() {
         return this.http.get<any>(this.url.customers);
     }
+    // create New Customer
+    createCustomer(customer, createParams) {
+        let url = this.url.createCustomer + customer;
+        return this.http.put(url, createParams);
+    }
+    // delete SelectCustomer
+    deleteSelectCustomer(params) {
+        let customerId = params.customerId,
+            version = params.version;
+        let url = this.url.deleteCustomer.replace("*_*", customerId).replace("*+*", version);
+        return this.http.delete(url);
+    }
+
+    //The following APIs are not optimizable ---------------------------------
+
     // get all servicetype
     getServiceTypes(customer) {
         let url = this.url.serviceType.replace("*_*", customer.id);
-        console.log(url)
         return this.http.get<any>(url);
     }
     // get Customer Pir
@@ -47,40 +61,26 @@ export class ManagemencsService {
         let url = this.url.CustomersColumn.replace("*_*", customer.id);
         return this.http.get<any>(url);
     }
-    // create New Customer
-    createCustomer(customer, createParams) {
-        let url = this.url.createCustomer + customer;
-        // return this.http.get(url, createParams);//location
-        return this.http.put(url, createParams);//online
-    }
-
+    // create ServiceType
     createServiceType(createParams) {
         let customerId = createParams.customer.id,
             ServiceType = createParams.ServiceType;
         let url = this.url.createServiceType.replace("*_*", customerId).replace("*+*", ServiceType);
-        // return this.http.get(url,createParams);//location
         return this.http.put(url, createParams);//online
     }
-
+    // Get delete Customer Version
     getdeleteCustomerVersion(thisdeleteCustomer) {
         let url = this.url.getCustomerresourceVersion.replace("*_*", thisdeleteCustomer.id);
         return this.http.get(url);
     }
-
-    deleteSelectCustomer(params) {
-        let customerId = params.customerId,
-            version = params.version;
-        let url = this.url.deleteCustomer.replace("*_*", customerId).replace("*+*", version);
-        return this.http.delete(url);
-    }
-
+    // Get delete ServiceType Version
     getdeleteServiceTypeVersion(params) {
         let customerId = params.customerId.id,
             ServiceType = params.ServiceType;
         let url = this.url.getServiceTypeResourceVersion.replace("*_*", customerId).replace("*+*", ServiceType);
         return this.http.get(url);
     }
-
+    // delete Select ServiceType
     deleteSelectServiceType(params) {
         let customerId = params.customerId.id,
             ServiceType = params.ServiceType,