+
-
Hello, {{ title }}
-
Congratulations! Your app is running. 🎉
+
+
+
-
-
-
- @for (item of [
- { title: 'Explore the Docs', link: 'https://angular.dev' },
- { title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' },
- { title: 'CLI Docs', link: 'https://angular.dev/tools/cli' },
- { title: 'Angular Language Service', link: 'https://angular.dev/tools/language-service' },
- { title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' },
- ]; track item.title) {
-
- {{ item.title }}
-
-
- }
-
-
+
+
+
+
+
+ Pode falar ou escrever.
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ Consultar faturas
+
+
+
+
+
+
+
+
+
+
+
+
+ Visualizar Dashboards
+
+
+
+
+
+
+
+
+
+
+
+
+ Ver relatórios de faturação
+
+
+
+
+
+
+
+
+
+
+
+
+ Ver relatórios de consumos
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Como posso ajudar?
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ChatBot-Frontend/src/app/app.component.ts b/ChatBot-Frontend/src/app/app.component.ts
index 52dd0c7..1c3e54c 100644
--- a/ChatBot-Frontend/src/app/app.component.ts
+++ b/ChatBot-Frontend/src/app/app.component.ts
@@ -1,13 +1,23 @@
import { Component } from '@angular/core';
-import { RouterOutlet } from '@angular/router';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+import { ChatService } from './chat.service';
@Component({
selector: 'app-root',
- standalone: true,
- imports: [RouterOutlet],
- templateUrl: './app.component.html',
- styleUrl: './app.component.css'
+ standalone: true,
+ imports: [CommonModule, FormsModule],
+ templateUrl: './app.component.html'
})
export class AppComponent {
- title = 'ChatBot';
-}
+ userMessage = '';
+ resposta: string | null = null;
+
+ constructor(private chatService: ChatService) {}
+
+ enviarMensagem() {
+ this.chatService.sendMessage(this.userMessage).subscribe((res: any) => {
+ this.resposta = res?.reply || 'Sem resposta do servidor';
+ });
+ }
+}
\ No newline at end of file
diff --git a/ChatBot-Frontend/src/app/app.config.ts b/ChatBot-Frontend/src/app/app.config.ts
index e5a3cf1..45e47cb 100644
--- a/ChatBot-Frontend/src/app/app.config.ts
+++ b/ChatBot-Frontend/src/app/app.config.ts
@@ -1,9 +1,14 @@
-import { ApplicationConfig } from '@angular/core';
+import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
import { provideRouter } from '@angular/router';
-
-import { routes } from './app.routes';
+import { provideHttpClient } from '@angular/common/http';
import { provideClientHydration } from '@angular/platform-browser';
+import { routes } from './app.routes';
export const appConfig: ApplicationConfig = {
- providers: [provideRouter(routes), provideClientHydration()]
-};
+ providers: [
+ provideZoneChangeDetection({ eventCoalescing: true }),
+ provideRouter(routes),
+ provideClientHydration(),
+ provideHttpClient()
+ ]
+};
\ No newline at end of file
diff --git a/ChatBot-Frontend/src/app/app.module.ts b/ChatBot-Frontend/src/app/app.module.ts
new file mode 100644
index 0000000..eb940fe
--- /dev/null
+++ b/ChatBot-Frontend/src/app/app.module.ts
@@ -0,0 +1,21 @@
+import { NgModule } from '@angular/core';
+import { BrowserModule } from '@angular/platform-browser';
+import { FormsModule } from '@angular/forms';
+import { HttpClientModule } from '@angular/common/http';
+import { RouterModule } from '@angular/router';
+import { AppComponent } from './app.component';
+
+@NgModule({
+ declarations: [
+ AppComponent
+ ],
+ imports: [
+ BrowserModule,
+ FormsModule,
+ HttpClientModule,
+ RouterModule.forRoot([])
+ ],
+ providers: [],
+ bootstrap: [AppComponent]
+})
+export class AppModule { }
\ No newline at end of file
diff --git a/ChatBot-Frontend/src/app/chat.service.ts b/ChatBot-Frontend/src/app/chat.service.ts
new file mode 100644
index 0000000..231f97b
--- /dev/null
+++ b/ChatBot-Frontend/src/app/chat.service.ts
@@ -0,0 +1,14 @@
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { Observable } from 'rxjs';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class ChatService {
+ constructor(private http: HttpClient) {}
+
+ sendMessage(message: string): Observable
{
+ return this.http.post('/api/chat', { message });
+ }
+}
\ No newline at end of file
diff --git a/ChatBot-Frontend/src/index.html b/ChatBot-Frontend/src/index.html
index 10694e2..ddc8335 100644
--- a/ChatBot-Frontend/src/index.html
+++ b/ChatBot-Frontend/src/index.html
@@ -2,12 +2,13 @@
- ChatBot
+ ChatBotFrontend
+
diff --git a/ChatBot-Frontend/src/styles.css b/ChatBot-Frontend/src/styles.css
index 90d4ee0..e69de29 100644
--- a/ChatBot-Frontend/src/styles.css
+++ b/ChatBot-Frontend/src/styles.css
@@ -1 +0,0 @@
-/* You can add global styles to this file, and also import other style files */