member_webapp/src/packages/probe/service/probe.service.ts
2018-04-29 19:43:14 +09:00

39 lines
897 B
TypeScript

import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import { RPCService } from '@loafer/ng-rpc/service';
import { Domain } from 'packages/domain/model';
import { Probe } from '../model';
@Injectable()
export class ProbeService {
public constructor(
private rpcService: RPCService,
) {
}
public readAllByDomain(domain: Domain): Observable<Probe[]> {
return this.rpcService.call<Probe[]>('ProbeService.readAllByDomain', domain);
}
public read(id: string): Observable<Probe> {
return this.rpcService.call<Probe>('ProbeService.read', id);
}
public modify(probe: Probe): Observable<Probe> {
return this.rpcService.call<Probe>('ProbeService.modify', probe);
}
public remove(id: string): Observable<boolean> {
return this.rpcService.call<boolean>('ProbeService.remove', id);
}
}