import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { Sensor, SensorData } from 'src/app/models/sensorData';

// import { FlowRatesEntity } from 'src/app/models/Wharf';

import { Wharf } from 'src/app/models/Wharf';

import { environment } from 'src/environments/environment';

@Injectable({
  providedIn: 'root',
})
export class GrondwaterstandService {
  url = environment.url;
  constructor(private httpClient: HttpClient) {}
  getValues(): Observable<SensorData[]> {
    return this.httpClient.get<SensorData[]>(
      this.url + '/sensordata/getsensordata'
    );
  }
  getSensors(): Observable<Sensor[]> {
    return this.httpClient.get<Sensor[]>(this.url + '/sensor/getsensors');
  }
  getWharfById(id: number): Observable<Wharf> {
    return this.httpClient.get<Wharf>(this.url + '/Wharf/' + id);
  }
}
