providing statistic data in statistic component
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
import { Kinosaal, Sitzplatz, Vorstellung, Film, OmdbSearch, Bestellung, Eintrittskarte } from '@infinimotion/model-frontend';
|
||||
import {
|
||||
Kinosaal,
|
||||
Sitzplatz,
|
||||
Vorstellung,
|
||||
Film,
|
||||
OmdbSearch,
|
||||
Bestellung,
|
||||
Eintrittskarte,
|
||||
StatisticsReduced, StatisticsFilm
|
||||
} from '@infinimotion/model-frontend';
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
@@ -154,8 +163,12 @@ export class HttpService {
|
||||
/* Show-Seats APIs */
|
||||
|
||||
/* GET /api/show-seats/{show} */
|
||||
getSeatsByShowId(show: number): Observable<{seats:Sitzplatz[], reserved:Sitzplatz[], booked:Sitzplatz[]}> {
|
||||
return this.http.get<{seats:Sitzplatz[], reserved:Sitzplatz[], booked:Sitzplatz[]}>(`${this.baseUrl}show-seats/${show}`);
|
||||
getSeatsByShowId(show: number): Observable<{ seats: Sitzplatz[], reserved: Sitzplatz[], booked: Sitzplatz[] }> {
|
||||
return this.http.get<{
|
||||
seats: Sitzplatz[],
|
||||
reserved: Sitzplatz[],
|
||||
booked: Sitzplatz[]
|
||||
}>(`${this.baseUrl}show-seats/${show}`);
|
||||
}
|
||||
|
||||
|
||||
@@ -164,12 +177,20 @@ export class HttpService {
|
||||
/* GET /api/importer/search */
|
||||
searchMovie(query: string): Observable<OmdbSearch> {
|
||||
return this.http.get<OmdbSearch>(`${this.baseUrl}importer/search`, {
|
||||
params: { title: query }
|
||||
params: {title: query}
|
||||
});
|
||||
}
|
||||
|
||||
/* POST /api/importer/import */
|
||||
importMovie(imdbId: string): Observable<Film> {
|
||||
return this.http.post<Film>(`${this.baseUrl}importer/import?id=${imdbId}`, {})
|
||||
return this.http.post<Film>(`${this.baseUrl}importer/import?id=${imdbId}`, {})
|
||||
}
|
||||
|
||||
|
||||
/* Statistics APIs */
|
||||
|
||||
/* GET /api/statistics/list */
|
||||
getStatisticsList(): Observable<StatisticsReduced> {
|
||||
return this.http.get<StatisticsReduced>(`${this.baseUrl}statistics/list`)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user