import { Injectable } from '@angular/core'; import { Observable } from 'rxjs/Observable'; import 'rxjs/add/operator/map'; import { RPCService } from '@loafer/ng-rpc'; // import { PageParams, Page } from 'app/commons/model'; import { SensorItem } from '@overflow/commons-typescript/model/sensor-item'; import { Sensor } from '@overflow/commons-typescript/model/sensor'; import { Domain } from '@overflow/commons-typescript/model/domain'; import { Target } from '@overflow/commons-typescript/model/target'; import { PageParams } from '@overflow/commons-typescript/model/commons/PageParams'; import { Page } from '@overflow/commons-typescript/model/commons/Page'; @Injectable() export class SensorService { public constructor( private rpcService: RPCService, ) { } public readAllByDomainID(domainID: number, pageParams: PageParams): Observable> { return this.rpcService.call('SensorService.readAllByDomainID', domainID, pageParams); } public registSensorConfig(sensor: Sensor, sensorItems: SensorItem[]): Observable { return this.rpcService.call('SensorService.registSensorConfig', sensor, sensorItems, null); } // public readAllByInfra(infraId: string, pageParams: PageParams): Observable { // return this.rpcService.call('SensorService.readAllByInfra', infraId, pageParams); // } // public readAllByTarget(target: Target, pageParams: PageParams): Observable { // return this.rpcService.call('SensorService.readAllByTarget', target, pageParams); // } public read(id: number): Observable { return this.rpcService.call('SensorService.read', id); } }