diff options
author | He Keguang <hekeguang@chinamobile.com> | 2021-09-16 07:29:40 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-09-16 07:29:40 +0000 |
commit | ddf7473db8cdd6a526e23b2ec32412a2bf4275c2 (patch) | |
tree | 0427b63350a2ae203324afd972d6587ea1ca0727 /usecaseui-portal/src/app/core | |
parent | 06d98cb853ae5d47d5cbe3d0a1a585194de5aaf9 (diff) | |
parent | c437d5360c75c1af5417c3681235a0f8015a9a85 (diff) |
Merge "feat: add intent based service"
Diffstat (limited to 'usecaseui-portal/src/app/core')
-rw-r--r-- | usecaseui-portal/src/app/core/services/intentBase.service.ts | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/usecaseui-portal/src/app/core/services/intentBase.service.ts b/usecaseui-portal/src/app/core/services/intentBase.service.ts new file mode 100644 index 00000000..b8ead336 --- /dev/null +++ b/usecaseui-portal/src/app/core/services/intentBase.service.ts @@ -0,0 +1,81 @@ +/* + Copyright (C) 2019 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +import { HttpClient, HttpParams } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { baseUrl } from '../models/dataInterface'; + +@Injectable() +export class intentBaseService { + constructor(private http: HttpClient) { } + + baseUrl = baseUrl.baseUrl; + url = { + getInstanceId: this.baseUrl + "/intent/getInstanceId", + createIntentInstance: this.baseUrl + "/intent/createIntentInstance", + getInstanceList: this.baseUrl + "/intent/getInstanceList", + queryInstancePerformanceData: this.baseUrl + "/intent/queryInstancePerformanceData", + getFinishedInstanceInfo: this.baseUrl + "/intent/getFinishedInstanceInfo", + deleteIntentInstance: this.baseUrl + "/intent/deleteIntentInstance", + activeIntentInstance: this.baseUrl + "/intent/activeIntentInstance", + invalidIntentInstance: this.baseUrl + "/intent/invalidIntentInstance", + queryAccessNodeInfo: this.baseUrl + "/intent/queryAccessNodeInfo", + intentInstancePredict: this.baseUrl + "/intent/intentInstancePredict" + }; + + //The following APIs function are optimizable------------------------ + + /* Query data list */ + getInstanceId() { + return this.http.get<any>(this.url["getInstanceId"]); + } + + createIntentInstance(requestBody) { + return this.http.post<any>(this.url["createIntentInstance"], requestBody); + } + + getInstanceList(requestBody) { + return this.http.post<any>(this.url["getInstanceList"], requestBody); + } + + queryInstancePerformanceData(requestBody) { + return this.http.post<any>(this.url["queryInstancePerformanceData"], requestBody); + } + + getFinishedInstanceInfo() { + return this.http.get<any>(this.url["getFinishedInstanceInfo"]); + } + + deleteIntentInstance(instanceId) { + let params = new HttpParams({ fromObject: { "instanceId": instanceId } }); + return this.http.delete<any>(this.url.deleteIntentInstance, { params }); + } + + activeIntentInstance(requestBody) { + return this.http.post<any>(this.url["activeIntentInstance"], requestBody); + } + + invalidIntentInstance(requestBody) { + return this.http.post<any>(this.url["invalidIntentInstance"], requestBody); + } + + queryAccessNodeInfo() { + return this.http.get<any>(this.url["queryAccessNodeInfo"]); + } + + intentInstancePredict(requestBody) { + return this.http.post<any>(this.url["intentInstancePredict"], requestBody); + } +} |