1
|
import { Injectable } from '@angular/core';
|
2
|
import { HttpClient } from '@angular/common/http';
|
3
|
import {Observable} from 'rxjs';
|
4
|
import { QueryResponse } from '../model/QueryResponse';
|
5
|
import {Query} from '../model/Query';
|
6
|
|
7
|
@Injectable({
|
8
|
providedIn: 'root'
|
9
|
})
|
10
|
export class QueryService {
|
11
|
|
12
|
backendUrl = 'http://localhost:8080/';
|
13
|
|
14
|
|
15
|
constructor( private httpClient: HttpClient) {}
|
16
|
|
17
|
sendQuery(query: Query): Observable<QueryResponse> {
|
18
|
return this.httpClient.post<QueryResponse>(this.backendUrl, query);
|
19
|
}
|
20
|
}
|