diff options
author | 2018-11-08 18:03:53 +0800 | |
---|---|---|
committer | 2018-11-08 18:04:36 +0800 | |
commit | 47f84a78ce57a122cabbcdba417a6b6acc3eb54c (patch) | |
tree | 89b17075c2884f777d4b98b4fe5d91fedc7e646e /usecaseui-portal/src/app/onboard.service.ts | |
parent | af41cf8c45aad0a940c45141cb9d5572423d60b9 (diff) |
Fix ns/vnf list display function
Change-Id: I38d2e2c493311c83a8c2da18367f1b7447a14dab
Issue-ID: USECASEUI-159
Signed-off-by: zhangab <zhanganbing@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/onboard.service.ts')
-rw-r--r-- | usecaseui-portal/src/app/onboard.service.ts | 224 |
1 files changed, 124 insertions, 100 deletions
diff --git a/usecaseui-portal/src/app/onboard.service.ts b/usecaseui-portal/src/app/onboard.service.ts index 5738256e..71b2f97c 100644 --- a/usecaseui-portal/src/app/onboard.service.ts +++ b/usecaseui-portal/src/app/onboard.service.ts @@ -7,104 +7,82 @@ import { onboardTableData, onboardDataVNF, onboardDataPNF } from './dataInterfac export class onboardService { constructor(private http: HttpClient) { } /* location */ - baseUrl = "./assets/json"; - url = { - // 数据列表 - onboardTableData: this.baseUrl + "/onboard-vnf-mf/onboardTableData.json", - onboardDataVNF: this.baseUrl + "/onboard-vnf-mf/onboardDataVNF.json", - onboardDataPNF: this.baseUrl + "/onboard-vnf-mf/onboardDataPNF.json", - //ns sdc - sdc_nsListData: this.baseUrl + "/onboard-vnf-mf/listData/SDC_NS.json", - // vnf sdc - sdc_vnfListData: this.baseUrl + "/onboard-vnf-mf/listData/SDC_VNF.json", - - //创建nspackages - creatensData: this.baseUrl + "/onboard-vnf-mf/_jsonData.json", - - //onboard ns sdc data - onboardNs: this.baseUrl + "/onboard-vnf-mf//listData/onboardNs.json", - //onboard VNF sdc data - onboardVNF: this.baseUrl + "/onboard-vnf-mf/listData/onboardVNF.json", - - // Delete ns package - deleteNspack: this.baseUrl + "/onboard-vnf-mf/deleteNspack.json", - // Delete Vnf vfc package - deleteVnfPack: this.baseUrl + "/deleteVnfPack.json", - // Delete Pnf package - deletePnfPack: this.baseUrl + "/deletePnfPack.json", - - // // download ns package - // downloadNsData: this.baseUrl + "/downloadData.json", - // //download vnf package - // downloadVnfData: this.baseUrl + "/listData/downloadVnfData.json" - - } - -//--------------------------------------------------------------------------------------- - /* line up 线上*/ - // baseUrl = "/api/usecaseui/server/v1/uui-lcm/"; - // baseUrlUp = "/api/usecaseui/server/v1/"; + // baseUrl = "./assets/json"; // url = { - // // 数据列表Data - // onboardTableData: this.baseUrl + "ns-packages", - // onboardDataVNF: this.baseUrl + "vnf-packages", - // onboardDataPNF: this.baseUrl + "pnf-packages", + // // 数据列表 + // onboardTableData: this.baseUrl + "/onboard-vnf-mf/onboardTableData.json", + // onboardDataVNF: this.baseUrl + "/onboard-vnf-mf/onboardDataVNF.json", + // onboardDataPNF: this.baseUrl + "/onboard-vnf-mf/onboardDataPNF.json", // //ns sdc - // sdc_nsListData: this.baseUrl + "sdc-ns-packages", - // //vnf sdc - // sdc_vnfListData: this.baseUrl + "sdc-vf-packages", + // sdc_nsListData: this.baseUrl + "/onboard-vnf-mf/listData/SDC_NS.json", + // // vnf sdc + // sdc_vnfListData: this.baseUrl + "/onboard-vnf-mf/listData/SDC_VNF.json", + - // //创建 creatensData - // creatensData: this.baseUrl + "_jsonData", //本地 + // //创建nspackages + // creatensData: this.baseUrl + "/onboard-vnf-mf/_jsonData.json", - // //onboard // //onboard ns sdc data - // onboardNs: this.baseUrl + "ns-packages", + // onboardNs: this.baseUrl + "/onboard-vnf-mf/listData/onboardNs.json", // //onboard VNF sdc data - // onboardVNF: this.baseUrl + "vf-packages", + // onboardVNF: this.baseUrl + "/onboard-vnf-mf/listData/onboardVNF.json", // // Delete ns package - // deleteNspack: this.baseUrl + "deleteNsdPackage?nsdInfoId=XXXXX", - // // Delete Vnf vfc package - // deleteVnfPack: this.baseUrl + "deleteVnfPackage?vnfPkgId=XXXXX", + // deleteNspack: this.baseUrl + "/onboard-vnf-mf/listData/deleteNspack.json", + // // Delete ns sdc package + // // deleteNssdcData: this.baseUrl + "/onboard-vnf-mf/listData/deleteNssdcData.json", + + // // Delete Vnf vfc package + // deleteVnfPack: this.baseUrl + "/onboard-vnf-mf/listData/deleteVnfPack.json", + // // Delete Vnf sdc package + // // deleteVnfsdcData: this.baseUrl + "/onboard-vnf-mf/listData/deleteVnfsdcData.json", + // // Delete Pnf package - // deletePnfPack: this.baseUrl + "", + // deletePnfPack: this.baseUrl + "/onboard-vnf-mf/listData/deletePnfPack.json", // // // download ns package - // // downloadNsData: this.baseUrl + "downLoadNsPackage?nsdInfoId=XXXXX", + // // downloadNsData: this.baseUrl + "/downloadData.json", // // //download vnf package - // // downloadVnfData: this.baseUrl + "downLoadVnfPackage?vnfPkgId=XXXXX" - - // } + // // downloadVnfData: this.baseUrl + "/listData/downloadVnfData.json" - //------------------------------------------------------------------------------------- - // baseUrl = 'http://172.19.44.223/api/usecaseui-server/v1'; - - // baseUrl = '/api/usecaseui/server/v1'; - // url={ - // // allhome:this.baseUrl + "/alarm/getAlarmDataByStatus/0", - // // homeLineData:this.baseUrl + "/...........", - // // serviceSelectList:this.baseUrl + "/xxxxxxxxxxxxx", - // // servicesTableData:this.baseUrl + "/xxxxxxxx.json", - // // onboardTableData:this.baseUrl + "/xxxxxxx.json", - - // // 数据列表 - // onboardTableData: this.baseUrl + "/uui-lcm/ns-packages", - // onboardDataVNF: this.baseUrl + "/uui-lcm/vnf-packages", - // onboardDataPNF: this.baseUrl + "/uui-lcm/pnf-packages", + // } - // //创建nspackages - // // creatensData: this.baseUrl + "/creatensData.json", - - // // deleteService: this.baseUrl + "/deleteService.json?", + //--------------------------------------------------------------------------------------- + /* line up 线上*/ + baseUrl = "/api/usecaseui/server/v1/uui-lcm/"; + baseUrlUp = "/api/usecaseui/server/v1/"; + url = { + // 数据列表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 + + // createnspackages ? TODO + creatensData: this.baseUrl + "createNetworkServiceData", //POST + + // 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?pnfPkgId=", + // // download ns package + // downloadNsData: this.baseUrl + "downLoadNsPackage?nsdInfoId=XXXXX", + // //download vnf package + // downloadVnfData: this.baseUrl + "downLoadVnfPackage?vnfPkgId=XXXXX" - // // Delete ns package - // deleteNspack: this.baseUrl + "/uui-lcm/deleteNsdPackage", - // // download ns package - // downloadNsData: this.baseUrl + "/downloadData.json/uui-lcm/downLoadNsPackage", - // } + } -//-----------------------------------Function-start------------------------------------------------------ + //-----------------------------------Function-start------------------------------------------------------ /* 查询数据列表 */ // NS Data getOnboardTableData(paramsObj): Observable<HttpResponse<any>> { @@ -119,14 +97,14 @@ export class onboardService { return this.http.get<onboardTableData>(this.url.sdc_nsListData, { observe: 'response', params }); // return this.http.get<any>(this.url["onboardTableData"]); } - - // VNF Data + + // VNF Data getOnboardTableVnfData(paramsObj): Observable<HttpResponse<onboardDataVNF>> { let params = new HttpParams({ fromObject: paramsObj }); return this.http.get<any>(this.url.onboardDataVNF, { observe: 'response', params }); } - // onboard VNF sdc Data - getSDC_VNFTableData(){ + // onboard VNF sdc Data + getSDC_VNFTableData() { return this.http.get<any>(this.url["sdc_vnfListData"]); } @@ -135,53 +113,68 @@ export class onboardService { let params = new HttpParams({ fromObject: paramsObj }); return this.http.get<any>(this.url.onboardDataPNF, { observe: 'response', params }); } -//------------------------------------------------------------------------------------- + //------------------------------------------------------------------------------------- //创建--上传前拖拽文件后,获取到id //线上接口 post // getCreatensData(url_upId,requestBody) { // return this.http.post<any>(this.url.creatensData.replace("_jsonData",url_upId),requestBody); //线上 // } - //创建--上传前拖拽文件后,获取到id //本地json get - getCreatensData(url_upId) { - return this.http.get<any>(this.url.creatensData.replace("_jsonData",url_upId)); + //创建--上传前拖拽文件后,获取到id //本地json get + getCreatensData(url_upId) { + return this.http.get<any>(this.url.creatensData.replace("_jsonData", url_upId)); } //------------------------------------------------------------------------------ //onboard sdc ns getNsonboard(requestBody) { - return this.http.post<any>(this.url["onboardNs"], requestBody); + return this.http.get<any>(this.url["onboardNs"], requestBody); } //onboard sdc vnf getVnfonboard(requestBody) { - return this.http.post<any>(this.url["onboardVNF"], requestBody); + return this.http.get<any>(this.url["onboardVNF"], requestBody); } //-------------------------------------------------------------------------- // Delete ns vfc package deleteNsIdData(paramsObj): Observable<HttpResponse<any>> { + // local test let params = new HttpParams({ fromObject: paramsObj }); - console.log(11111,params) + console.log(11111, params) return this.http.get<any>(this.url.deleteNspack, { observe: 'response', params }); - // return this.http.delete<any>(this.url["deleteNspack"], { observe: 'response', params }); + + // Online test + // return this.http.delete<any>(this.url["deleteNspack"] + paramsObj); } + // delete ns sdc package + // deleteNssdcData(){ + // return this.http.get<any>(this.url.deleteNssdcData); //Local simulation + // // return this.http.delete<any>(this.url.deleteNssdcData + id); + // } // Delete Vnf vfc package deleteVnfIdData(paramsObj): Observable<HttpResponse<any>> { let params = new HttpParams({ fromObject: paramsObj }); - console.log(11111,params) + console.log(11111, params) return this.http.get<any>(this.url.deleteVnfPack, { observe: 'response', params }); - // return this.http.delete<any>(this.url["deleteNspack"], { observe: 'response', params }); + //online test + // return this.http.delete<any>(this.url["deleteVnfpack"] + paramsObj); } + // Delete Vnf sdc package + // deleteVnfsdcData(){ + // return this.http.get<any>(this.url.deleteVnfsdcData); + // } + // Delete Pnf package deletePnfIdData(paramsObj): Observable<HttpResponse<any>> { let params = new HttpParams({ fromObject: paramsObj }); - console.log(11111,params) + console.log(11111, params) return this.http.get<any>(this.url.deletePnfPack, { observe: 'response', params }); - // return this.http.delete<any>(this.url["deleteNspack"], { observe: 'response', params }); + //online test + // return this.http.delete<any>(this.url["deletePnfpack"] + paramsObj); } -//------------------------------------------------------------------------------ + //------------------------------------------------------------------------------ // download nspak // downloadNsData(paramsObj): Observable<HttpResponse<any>> { // console.log(66,paramsObj) @@ -192,6 +185,37 @@ export class onboardService { // downloadVnfData(){ // return this.http.get<any>(this.url.downloadVnfData) // } -//---------------------------------Function-end------------------------------------------- + + // testObservable() { + // let myObservable = new Observable((observer) => { + // observer.next(1); + // observer.next((n) => { + // console.log(3 + n); + // }) + // setTimeout(() => { + // observer.next(66666) + // }, 100) + // observer.next(() => { + // setTimeout((n) => { + // console.log("9999---" + n); + // }, 10) + // }) + // // observer.error(2); + // // observer.complete(); + // }); + + // myObservable.subscribe((e) => { + // if (typeof e == "function") { + // e(5) + // } + // console.log(e); + // }, (err) => { + // console.log(err); + // }, () => { + // console.log(555); + // }) + // } + + //---------------------------------Function-end------------------------------------------- } |