diff options
author | 2019-05-06 17:39:20 +0800 | |
---|---|---|
committer | 2019-05-06 17:59:10 +0800 | |
commit | bf240f4fad6e8bf032bd1f190b238682a9fb721a (patch) | |
tree | e1aa6be71ca760a2626e29fbdf36af016c78cdfc /usecaseui-portal/src/app/managemencs.service.ts | |
parent | b4bbbe86cf1410d6fa10d3d6d2b418133e34c45c (diff) |
User and service type management interface
Change-Id: Ie4f66f28ea964cd8a773e7c1c52e5d589762b371
Issue-ID: USECASEUI-212
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/managemencs.service.ts')
-rw-r--r-- | usecaseui-portal/src/app/managemencs.service.ts | 84 |
1 files changed, 68 insertions, 16 deletions
diff --git a/usecaseui-portal/src/app/managemencs.service.ts b/usecaseui-portal/src/app/managemencs.service.ts index 686d6180..62113133 100644 --- a/usecaseui-portal/src/app/managemencs.service.ts +++ b/usecaseui-portal/src/app/managemencs.service.ts @@ -8,25 +8,36 @@ import {baseUrl} from './dataInterface'; export class ManagemencsService { constructor(private http: HttpClient) { } - baseUrl = baseUrl.baseUrl + baseUrl = baseUrl.baseUrl; - /* location */ - url = { - customers:this.baseUrl + "/customers/customers_list.json?", - serviceType:this.baseUrl + "/serviceTypes.json?*_*", - CustomersPir:this.baseUrl + "/customers/customersber.json?", - CustomersColumn:this.baseUrl + "/customers/customersber.json?", - - } + /* location */ + // url = { + // customers: this.baseUrl + "/customers/customers_list.json", + // serviceType: this.baseUrl + "/serviceTypes.json?*_*", + // CustomersPir: this.baseUrl + "/customers/customersber.json", + // CustomersColumn: this.baseUrl + "/customers/customersber.json?*_*", + // createCustomer: this.baseUrl + "/customers/createCustomer.json?", + // createServiceType: this.baseUrl + "/customers/createServiceType.json", + // getCustomerResourceVersion: this.baseUrl + "/customers/deleteCustomer.json?*_*", + // deleteCustomer: this.baseUrl + "/customers/createServiceType.json", + // getServiceTypeResourceVersion: this.baseUrl + "/customers/deleteCustomer.json?*_*", + // deleteServiceType: this.baseUrl + "/customers/createServiceType.json", + // }; - /* line up */ - // url = { - // customers:this.baseUrl + "/uui-lcm/customers",/* get */ - // serviceType:this.baseUrl + "/uui-lcm/customers/"+"*_*"+"/service-subscriptions",/* get */ - // CustomersPir:this.baseUrl + "/uui-lcm/serviceNumByCustomer",/* get */ - // CustomersColumn:this.baseUrl + "/uui-lcm/serviceNumByServiceType/"+"*_*",/* get */ - // } + /* line up */ + url = { + customers:this.baseUrl + "/uui-lcm/customers", /* get */ + serviceType:this.baseUrl + "/uui-lcm/customers/"+"*_*"+"/service-subscriptions", /* get */ + CustomersPir:this.baseUrl + "/uui-lcm/serviceNumByCustomer", /* 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=*@* ", + }; // Get all customers @@ -48,4 +59,45 @@ 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 + } + + 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 + } + + 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); + } + + getdeleteServiceTypeVersion(params) { + let customerId = params.customerId.id, + ServiceType = params.ServiceType; + let url = this.url.getServiceTypeResourceVersion.replace("*_*", customerId).replace("*+*", ServiceType); + return this.http.get(url); + } + + deleteSelectServiceType(params) { + let customerId = params.customerId.id, + ServiceType = params.ServiceType, + version = params.version; + let url = this.url.deleteServiceType.replace("*_*", customerId).replace("*+*", ServiceType).replace("*@*", version); + return this.http.delete(url); + } } |