member_webapp/@overflow/probe/service/probe.service.ts
crusader d59d9379f9 ing
2018-05-24 15:44:13 +09:00

43 lines
1.1 KiB
TypeScript

import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import { RPCService } from '@loafer/ng-rpc';
import { Domain } from '@overflow/commons-typescript/model/domain';
import { Probe } from '@overflow/commons-typescript/model/probe';
@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);
}
public modifyDisplayName(id: string, displayName: string): Observable<Probe> {
return this.rpcService.call<Probe>('ProbeService.modifyDisplayName', id, displayName);
}
}