import { Injectable } from "@angular/core"; import { HttpClient, HttpHeaders } from "@angular/common/http"; import { Observable } from "rxjs"; @Injectable({ providedIn: "root", }) export class EnergyMonitoringService { constructor(private http: HttpClient) {} getListRoomData(): Observable { const url = `https://kapi.absys.ninja/hemat/room/list`; const headers = new HttpHeaders({ 'Content-Type': 'application/json', 'x-api-key': 'j2yaYvPSQcsEEmHh3NEobfiXyyXmmnHT' }); return this.http.get(url, { headers }); } getDashboardTopCard(id): Observable { const url = `https://kapi.absys.ninja/hemat/dashboard/top-card?building_id=${id}`; const headers = new HttpHeaders({ 'Content-Type': 'application/json', 'x-api-key': 'j2yaYvPSQcsEEmHh3NEobfiXyyXmmnHT' }); return this.http.get(url, { headers }); } getDashboardSummary(id): Observable { const url = `https://kapi.absys.ninja/hemat/dashboard/summary-cost?building_id=${id}`; const headers = new HttpHeaders({ 'Content-Type': 'application/json', 'x-api-key': 'j2yaYvPSQcsEEmHh3NEobfiXyyXmmnHT' }); return this.http.get(url, { headers }); } getDashboardAirQuality(id): Observable { const url = `https://kapi.absys.ninja/hemat/dashboard/air-quality?building_id=${id}`; const headers = new HttpHeaders({ 'Content-Type': 'application/json', 'x-api-key': 'j2yaYvPSQcsEEmHh3NEobfiXyyXmmnHT' }); return this.http.get(url, { headers }); } getDashboardTemperature(id): Observable { const url = `https://kapi.absys.ninja/hemat/dashboard/temperature-humidity?building_id=${id}`; const headers = new HttpHeaders({ 'Content-Type': 'application/json', 'x-api-key': 'j2yaYvPSQcsEEmHh3NEobfiXyyXmmnHT' }); return this.http.get(url, { headers }); } getDashboardDeviceCategory(id): Observable { const url = `https://kapi.absys.ninja/hemat/dashboard/device-category-use?building_id=${id}`; const headers = new HttpHeaders({ 'Content-Type': 'application/json', 'x-api-key': 'j2yaYvPSQcsEEmHh3NEobfiXyyXmmnHT' }); return this.http.get(url, { headers }); } getDashboardChartKwhWater(id): Observable { const url = `https://kapi.absys.ninja/hemat/dashboard/chartKwhWater?building_id=${id}`; const headers = new HttpHeaders({ 'Content-Type': 'application/json', 'x-api-key': 'j2yaYvPSQcsEEmHh3NEobfiXyyXmmnHT' }); return this.http.get(url, { headers }); } }