summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app
diff options
context:
space:
mode:
authorzhenzhenbai <850084376@qq.com>2022-11-29 16:58:21 +0800
committerzhenzhenbai <850084376@qq.com>2022-11-29 16:58:21 +0800
commit725979e1ecfd3817a48a547cb28edf9536adc676 (patch)
tree740b0be018305644dc52324b396961957ea33dcd /usecaseui-portal/src/app
parent3909a4f66a1ec8e0f9418107fa29d05fa317068e (diff)
modify the URL of the get interface
Modify the URL of the get interface of the intention,and add a prompt message for adding,deleting,modifying,and querying the intention. Issue-ID: USECASEUI-763 Signed-off-by: zhenzhenbai <850084376@qq.com> Change-Id: I66e9b9bccfc7c91809427bce693ede0a7ecddaa1
Diffstat (limited to 'usecaseui-portal/src/app')
-rw-r--r--usecaseui-portal/src/app/core/services/intentManagement.service.ts2
-rw-r--r--usecaseui-portal/src/app/views/intent-management/input-intent-management/input-intent-management.component.ts20
-rw-r--r--usecaseui-portal/src/app/views/intent-management/intent-management.component.ts19
3 files changed, 32 insertions, 9 deletions
diff --git a/usecaseui-portal/src/app/core/services/intentManagement.service.ts b/usecaseui-portal/src/app/core/services/intentManagement.service.ts
index 21b6f37e..de0216db 100644
--- a/usecaseui-portal/src/app/core/services/intentManagement.service.ts
+++ b/usecaseui-portal/src/app/core/services/intentManagement.service.ts
@@ -23,7 +23,7 @@ export class IntentManagementService {
constructor(private http: HttpClient) { }
url = {
createIntentManagement: "/api/usecaseui-intent-analysis/v1/intents",
- getIntentManagement: "/api/usecaseui-intent-analysis/v1/intents",
+ getIntentManagement: "/api/usecaseui-intent-analysis/v1/intents/intentGenerateType/USERINPUT",
deleteIntentManagement: "/api/usecaseui-intent-analysis/v1/intents/",
updateIntentManagementData: "/api/usecaseui-intent-analysis/v1/intents/"
};
diff --git a/usecaseui-portal/src/app/views/intent-management/input-intent-management/input-intent-management.component.ts b/usecaseui-portal/src/app/views/intent-management/input-intent-management/input-intent-management.component.ts
index 1a6b95e2..71624423 100644
--- a/usecaseui-portal/src/app/views/intent-management/input-intent-management/input-intent-management.component.ts
+++ b/usecaseui-portal/src/app/views/intent-management/input-intent-management/input-intent-management.component.ts
@@ -1,6 +1,7 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { IntentManagementService } from '../../../core/services/intentManagement.service';
import { Util } from '../../../shared/utils/utils';
+import {NzMessageService} from "ng-zorro-antd";
@Component({
selector: 'app-input-intent-management',
@@ -11,7 +12,8 @@ export class InputIntentManagementComponent implements OnInit {
constructor(
private myhttp: IntentManagementService,
- private Util: Util
+ private Util: Util,
+ private message: NzMessageService,
) { }
defaultParams:Object={
intentId:'',
@@ -140,9 +142,15 @@ export class InputIntentManagementComponent implements OnInit {
(response) => {
this.showModel = false;
this.modalOpreation.emit({ "cancel": false });
+ if(response.result_header.result_code===200){
+ this.message.success('Created successfully');
+ }else{
+ this.message.error(response.result_header.result_message);
+ }
},
(err) => {
- console.log(err);
+ this.showModel = false;
+ this.message.error('Created failed');
}
)
}
@@ -153,9 +161,15 @@ export class InputIntentManagementComponent implements OnInit {
(response) => {
this.showModel = false;
this.modalOpreation.emit({ "cancel": false});
+ if(response.result_header.result_code===200){
+ this.message.success('Modification succeeded');
+ }else{
+ this.message.error(response.result_header.result_message);
+ }
},
(err) => {
- console.log(err);
+ this.showModel = false;
+ this.message.error('upload fail');
}
)
}
diff --git a/usecaseui-portal/src/app/views/intent-management/intent-management.component.ts b/usecaseui-portal/src/app/views/intent-management/intent-management.component.ts
index 7fc9f7e6..758aad06 100644
--- a/usecaseui-portal/src/app/views/intent-management/intent-management.component.ts
+++ b/usecaseui-portal/src/app/views/intent-management/intent-management.component.ts
@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { IntentManagementService } from '../../core/services/intentManagement.service'
+import {NzMessageService} from "ng-zorro-antd";
@Component({
selector: 'app-intent-management',
@@ -8,7 +9,10 @@ import { IntentManagementService } from '../../core/services/intentManagement.se
})
export class IntentManagementComponent implements OnInit {
- constructor(private myhttp: IntentManagementService) { }
+ constructor(
+ private myhttp: IntentManagementService,
+ private message: NzMessageService,
+ ) { }
ngOnInit() {
this.getIntentManagementData()
@@ -23,10 +27,10 @@ export class IntentManagementComponent implements OnInit {
this.myhttp.getIntentManagementData()
.subscribe(
(data) => {
- this.listOfData=data
+ this.listOfData=data.result_body
},
(err) => {
- console.error(err);
+ this.message.error('Failed to obtain intent data');
}
)
}
@@ -49,8 +53,13 @@ export class IntentManagementComponent implements OnInit {
deleteIntentList(data): void{
this.myhttp.deleteIntentManagementData(data.intentId).subscribe((data) => {
this.getIntentManagementData()
+ if(data.result_header.result_code===200){
+ this.message.success('Deleted successfully');
+ }else{
+ this.message.error(data.result_header.result_message);
+ }
}, (err) => {
- console.log(err);
- });
+ this.message.error('Deletion failed');
+ });
}
} \ No newline at end of file