diff options
author | cyuamber <xuranyjy@chinamobile.com> | 2019-08-29 18:43:08 +0800 |
---|---|---|
committer | xu ran <xuranyjy@chinamobile.com> | 2019-08-30 02:20:49 +0000 |
commit | 0c1e82ccbfa6dcb8ee5d11220a93fefc61465374 (patch) | |
tree | dbd894bc5909df38bde9a2738e366d7913627195 /usecaseui-portal/src/app/core | |
parent | cbb4b91ad39b44a76d1b1d4b745ef2b38fab74ce (diff) |
feat: change the mock data path config file
Change-Id: I5ca301d8ff0b084f64366312543c9036d8e76de8
Issue-ID: USECASEUI-307
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/core')
4 files changed, 109 insertions, 115 deletions
diff --git a/usecaseui-portal/src/app/core/services/myhttp.service.ts b/usecaseui-portal/src/app/core/services/myhttp.service.ts index bcb83e21..cc9c181a 100644 --- a/usecaseui-portal/src/app/core/services/myhttp.service.ts +++ b/usecaseui-portal/src/app/core/services/myhttp.service.ts @@ -59,66 +59,66 @@ export class MyhttpService { //The following APIs are optimizable - // Get all customers - getAllCustomers() { - return this.http.get<any>(this.url.customers); - } - // Get all Orchestrators - getAllOrchestrators() { - return this.http.get<any>(this.url.orchestrators); - } - // serviceTable list - getServicesTableData(paramsObj): Observable<HttpResponse<servicesTableData>> { - let params = new HttpParams({ fromObject: paramsObj }); - return this.http.get<servicesTableData>(this.url.servicesTableData, { observe: 'response', params }); - } - // Get all template types - getAllServiceTemplates(type) { - if (type == "Network Service") { - let nsUrl = this.url.serviceTemplates.replace("service-templates", "listNsTemplates").replace("serviceTemplates2", "serviceTemplates-ns"); - console.log(nsUrl); - return this.http.get<any>(nsUrl); - } - return this.http.get<any>(this.url.serviceTemplates); - } - // Get Vim Info - getVimInfo() { - return this.http.get<any>(this.url.vimInfo); - }; - //Get SdnControllers - getSdnControllers() { - return this.http.get<any>(this.url.sdnControllers); - } - // Create interface - createInstance(requestBody, createParams) { - return this.http.post<any>(this.url.createService + createParams, requestBody); - } - // NS CreateInstance step one - nsCreateInstance(requestBody) { - return this.http.post<any>(this.url.ns_createService, requestBody); - } - // NS CreateInstance step two - nsCreateInstance2(params, requestBody) { - return this.http.post<any>(this.url.ns_createService2 + params, requestBody); - } - //Delete ns Service - nsDeleteInstance(id) { - return this.http.delete<any>(this.url.ns_deleteService + id); - } - //stop ns Service - stopNsService(id, requestBody) { //You need to terminate before deleting - return this.http.post<any>(this.url.ns_stopService + id, requestBody); - } - //heal ns Service - healNsService(id, requestBody) { - return this.http.post<any>(this.url.ns_healService + id, requestBody); - } - //Get allotted-resource to get tp and pnf values - getAllottedResource(obj) { - let params = new HttpParams({ fromObject: obj }); - let url = this.url.allottedResource; - return this.http.get<any>(url, { params }); + // Get all customers + getAllCustomers() { + return this.http.get<any>(this.url.customers); + } + // Get all Orchestrators + getAllOrchestrators() { + return this.http.get<any>(this.url.orchestrators); + } + // serviceTable list + getServicesTableData(paramsObj): Observable<HttpResponse<servicesTableData>> { + let params = new HttpParams({ fromObject: paramsObj }); + return this.http.get<servicesTableData>(this.url.servicesTableData, { observe: 'response', params }); + } + // Get all template types + getAllServiceTemplates(type) { + if (type == "Network Service") { + let nsUrl = this.url.serviceTemplates.replace("service-templates", "listNsTemplates").replace("serviceTemplates2", "serviceTemplates-ns"); + console.log(nsUrl); + return this.http.get<any>(nsUrl); } + return this.http.get<any>(this.url.serviceTemplates); + } + // Get Vim Info + getVimInfo() { + return this.http.get<any>(this.url.vimInfo); + }; + //Get SdnControllers + getSdnControllers() { + return this.http.get<any>(this.url.sdnControllers); + } + // Create interface + createInstance(requestBody, createParams) { + return this.http.post<any>(this.url.createService + createParams, requestBody); + } + // NS CreateInstance step one + nsCreateInstance(requestBody) { + return this.http.post<any>(this.url.ns_createService, requestBody); + } + // NS CreateInstance step two + nsCreateInstance2(params, requestBody) { + return this.http.post<any>(this.url.ns_createService2 + params, requestBody); + } + //Delete ns Service + nsDeleteInstance(id) { + return this.http.delete<any>(this.url.ns_deleteService + id); + } + //stop ns Service + stopNsService(id, requestBody) { //You need to terminate before deleting + return this.http.post<any>(this.url.ns_stopService + id, requestBody); + } + //heal ns Service + healNsService(id, requestBody) { + return this.http.post<any>(this.url.ns_healService + id, requestBody); + } + //Get allotted-resource to get tp and pnf values + getAllottedResource(obj) { + let params = new HttpParams({ fromObject: obj }); + let url = this.url.allottedResource; + return this.http.get<any>(url, { params }); + } //The following APIs are not optimizable --------------------------------- diff --git a/usecaseui-portal/src/app/core/services/onboard.service.ts b/usecaseui-portal/src/app/core/services/onboard.service.ts index c3959a29..ea312d34 100644 --- a/usecaseui-portal/src/app/core/services/onboard.service.ts +++ b/usecaseui-portal/src/app/core/services/onboard.service.ts @@ -20,58 +20,58 @@ import { baseUrl } from '../models/dataInterface'; @Injectable() export class onboardService { - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) { } - baseUrl = baseUrl.baseUrl + "/uui-lcm/"; - url = { - //The following APIs are optimizable------------------------ - // list Data - onboardTableData: this.baseUrl + "ns-packages", - onboardDataVNF: this.baseUrl + "vnf-packages", - onboardDataPNF: this.baseUrl + "pnf-packages", - //ns sdc - sdc_nsListData: this.baseUrl + "sdc-ns-packages", // GET - // vnf sdc - sdc_vnfListData: this.baseUrl + "sdc-vf-packages", // GET - // onboard ns sdc data - onboardNs: this.baseUrl + "ns-packages", //POST - //onboard VNF sdc data - onboardVNF: this.baseUrl + "vf-packages", //POST - //Delete ns package - deleteNspack: this.baseUrl + "deleteNsdPackage?nsdInfoId=", - // Delete Vnf vfc package - deleteVnfPack: this.baseUrl + "deleteVnfPackage?vnfPkgId=", - // Delete Pnf package - deletePnfPack: this.baseUrl + "deletePnfPackage?pnfdInfoId=", - // The following APIs are not optimizable------------------- - // createnspackages - creatensData: this.baseUrl + "_jsonData", //POST - //Progress interface - progress: this.baseUrl + "jobs/" + "_jobId" + "?responseId=" - }; + baseUrl = baseUrl.baseUrl + "/uui-lcm/"; + url = { + //The following APIs are optimizable------------------------ + // list Data + onboardTableData: this.baseUrl + "ns-packages", + onboardDataVNF: this.baseUrl + "vnf-packages", + onboardDataPNF: this.baseUrl + "pnf-packages", + //ns sdc + sdc_nsListData: this.baseUrl + "sdc-ns-packages", // GET + // vnf sdc + sdc_vnfListData: this.baseUrl + "sdc-vf-packages", // GET + // onboard ns sdc data + onboardNs: this.baseUrl + "ns-packages", //POST + //onboard VNF sdc data + onboardVNF: this.baseUrl + "vf-packages", //POST + //Delete ns package + deleteNspack: this.baseUrl + "deleteNsdPackage?nsdInfoId=", + // Delete Vnf vfc package + deleteVnfPack: this.baseUrl + "deleteVnfPackage?vnfPkgId=", + // Delete Pnf package + deletePnfPack: this.baseUrl + "deletePnfPackage?pnfdInfoId=", + // The following APIs are not optimizable------------------- + // createnspackages + creatensData: this.baseUrl + "_jsonData", //POST + //Progress interface + progress: this.baseUrl + "jobs/" + "_jobId" + "?responseId=" + }; - //The following APIs function are optimizable------------------------ + //The following APIs function are optimizable------------------------ /* Query data list */ // NS Data getOnboardTableData() { - return this.http.get<any>(this.url["onboardTableData"]); + return this.http.get<any>(this.url["onboardTableData"]); } // NS SDC Data getSDC_NSTableData() { - return this.http.get<any>(this.url["sdc_nsListData"]); + return this.http.get<any>(this.url["sdc_nsListData"]); } // VNF Data getOnboardTableVnfData() { - return this.http.get<any>(this.url.onboardDataVNF); + return this.http.get<any>(this.url.onboardDataVNF); } // onboard VNF sdc Data getSDC_VNFTableData() { - return this.http.get<any>(this.url["sdc_vnfListData"]); + return this.http.get<any>(this.url["sdc_vnfListData"]); } // PNF Data getOnboardTablePnfData() { - return this.http.get<any>(this.url.onboardDataPNF); + return this.http.get<any>(this.url.onboardDataPNF); } //onboard sdc ns getNsonboard(requestBody) { @@ -98,12 +98,12 @@ export class onboardService { //create--Get the id after dragging the file before uploading getCreatensData(url_upId, requestBody) { - return this.http.post<any>(this.url.creatensData.replace("_jsonData", url_upId), requestBody); + return this.http.post<any>(this.url.creatensData.replace("_jsonData", url_upId), requestBody); } //onboard progress getProgress(jobid, responseId) { - let url = this.url.progress.replace("_jobId", jobid) + responseId; - return this.http.get<any>(url); + let url = this.url.progress.replace("_jobId", jobid) + responseId; + return this.http.get<any>(url); } } diff --git a/usecaseui-portal/src/app/core/services/text.service.spec.ts b/usecaseui-portal/src/app/core/services/text.service.spec.ts deleted file mode 100644 index 7b4d9efc..00000000 --- a/usecaseui-portal/src/app/core/services/text.service.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { TestBed, inject } from '@angular/core/testing'; - -import { TextService } from './text.service'; - -describe('TextService', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [TextService] - }); - }); - - it('should be created', inject([TextService], (service: TextService) => { - expect(service).toBeTruthy(); - })); -}); diff --git a/usecaseui-portal/src/app/core/services/text.service.ts b/usecaseui-portal/src/app/core/services/text.service.ts index 9ccea18a..9698ee64 100644 --- a/usecaseui-portal/src/app/core/services/text.service.ts +++ b/usecaseui-portal/src/app/core/services/text.service.ts @@ -20,14 +20,16 @@ import { HttpClient } from '@angular/common/http'; export class TextService { constructor(private http: HttpClient) { } //--------------------------------------------------------------------------------------- - /* line up*/ baseUrl = "/api"; + url = { textInterface: this.baseUrl + "/user/login", singleInterface: this.baseUrl + "/home", doubleInterface: this.baseUrl + "/customer/info", - multipleInterface: this.baseUrl + "/alarm/formdata/multiple", + multipleInterface: this.baseUrl + "/alarm/form/data", jsonInterface: this.baseUrl + "/xuran/test/data", + currentLanguage: "/api/portal-auxapi/languageSetting/user/", + creatensData: this.baseUrl + "_jsonData", //POST } //-----------------------------------Function-local-start------------------------------------------------------ @@ -35,8 +37,15 @@ export class TextService { getfakeData() { return this.http.get<any>(this.url["singleInterface"]); } - getjsonData() { - return this.http.get<any>(this.url["multipleInterface"]); + getjsonData(user) { + return this.http.get<any>(this.url["multipleInterface"], user); + } + getCurrentLanguage(currentloginId) { + let url = this.url.currentLanguage + currentloginId; + return this.http.get<any>(url); + } + getCreatensData(url_upId: string, requestBody: object) { + return this.http.post<any>(this.url.creatensData.replace("_jsonData", url_upId), requestBody); } //------------------------------------------------------------------------------------- |