42 lines
1.4 KiB
TypeScript
Raw Normal View History

2018-04-06 20:02:18 +09:00
import { Injectable } from '@angular/core';
2018-06-04 17:25:29 +09:00
import { Observable } from 'rxjs';
2018-04-06 20:02:18 +09:00
2018-05-24 15:44:13 +09:00
import { RPCService } from '@loafer/ng-rpc';
2018-04-06 20:02:18 +09:00
2018-05-24 15:44:13 +09:00
// import { PageParams, Page } from 'app/commons/model';
2018-06-12 14:45:21 +09:00
import { Sensor, SensorItem } from '@overflow/commons-typescript/model/sensor';
2018-05-02 17:09:39 +09:00
import { Domain } from '@overflow/commons-typescript/model/domain';
import { Target } from '@overflow/commons-typescript/model/target';
2018-06-07 16:28:27 +09:00
import { Page, PageParams } from '@overflow/commons-typescript/core/model';
2018-04-06 20:02:18 +09:00
@Injectable()
export class SensorService {
public constructor(
private rpcService: RPCService,
) {
}
2018-05-27 23:17:07 +09:00
public readAllByDomainID(domainID: number, pageParams: PageParams): Observable<Page<Sensor>> {
return this.rpcService.call('SensorService.readAllByDomainID', domainID, pageParams);
}
2018-04-06 20:02:18 +09:00
public registSensorConfig(sensor: Sensor, sensorItems: SensorItem[]): Observable<Sensor> {
return this.rpcService.call('SensorService.registSensorConfig', sensor, sensorItems, null);
}
2018-05-24 15:44:13 +09:00
// public readAllByInfra(infraId: string, pageParams: PageParams): Observable<Page> {
// return this.rpcService.call('SensorService.readAllByInfra', infraId, pageParams);
// }
2018-04-06 20:02:18 +09:00
2018-05-24 15:44:13 +09:00
// public readAllByTarget(target: Target, pageParams: PageParams): Observable<Page> {
// return this.rpcService.call('SensorService.readAllByTarget', target, pageParams);
// }
2018-06-04 14:19:55 +09:00
public read(id: number): Observable<Sensor> {
return this.rpcService.call<Sensor>('SensorService.read', id);
}
2018-04-06 20:02:18 +09:00
}