From d5f18c422a770ff04b44e87deefec50516b0fef3 Mon Sep 17 00:00:00 2001 From: cyuamber Date: Fri, 23 Aug 2019 17:55:34 +0800 Subject: feat:customer page api sort out add notes Change-Id: I3b2e4b9744d3b7577cc38d63e666be004a0f0d17 Issue-ID: USECASEUI-307 Signed-off-by: cyuamber --- .../src/app/core/services/managemencs.service.ts | 48 +++++++++++----------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'usecaseui-portal/src/app/core') diff --git a/usecaseui-portal/src/app/core/services/managemencs.service.ts b/usecaseui-portal/src/app/core/services/managemencs.service.ts index a28885d8..da43b8f5 100644 --- a/usecaseui-portal/src/app/core/services/managemencs.service.ts +++ b/usecaseui-portal/src/app/core/services/managemencs.service.ts @@ -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(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(url); } // get Customer Pir @@ -47,40 +61,26 @@ export class ManagemencsService { let url = this.url.CustomersColumn.replace("*_*", customer.id); return this.http.get(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, -- cgit 1.2.3-korg