import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';

import 'rxjs/add/operator/map';

import { RPCService } from '@loafer/ng-rpc';
import { MetaCrawler } from '@overflow/commons-typescript/model/meta';
import { MetaSensorDisplayItem } from '@overflow/commons-typescript/model/meta';


@Injectable()
export class MetaSensorDisplayItemService {

  public constructor(
    private rpcService: RPCService,
  ) {

  }

  public read(id: number): Observable<MetaSensorDisplayItem> {
    return this.rpcService.call('MetaSensorDisplayItemService.read', id);
  }

  public readAllByCrawlerID(metaCrawlerID: number): Observable<MetaSensorDisplayItem[]> {
    return this.rpcService.call('MetaSensorDisplayItemService.readAllByCrawler', metaCrawlerID);
  }
}
