37 lines
905 B
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-02 17:09:39 +09:00
import { Domain } from '@overflow/commons-typescript/model/domain';
2018-04-06 20:02:18 +09:00
2018-05-02 17:09:39 +09:00
import { Probe } from '@overflow/commons-typescript/model/probe';
2018-04-06 20:02:18 +09:00
@Injectable()
export class ProbeService {
public constructor(
private rpcService: RPCService,
) {
}
2018-06-14 13:38:51 +09:00
public readAllByDomainID(domainID: number): Observable<Probe[]> {
return this.rpcService.call<Probe[]>('ProbeService.readAllByDomainID', domainID);
2018-04-06 20:02:18 +09:00
}
2018-06-04 17:25:29 +09:00
public read(id: number): Observable<Probe> {
2018-04-06 20:02:18 +09:00
return this.rpcService.call<Probe>('ProbeService.read', id);
}
2018-04-25 18:04:47 +09:00
2018-04-27 16:31:27 +09:00
public modify(probe: Probe): Observable<Probe> {
return this.rpcService.call<Probe>('ProbeService.modify', probe);
}
2018-06-04 17:25:29 +09:00
public remove(id: number): Observable<boolean> {
2018-04-29 19:43:14 +09:00
return this.rpcService.call<boolean>('ProbeService.remove', id);
}
2018-04-06 20:02:18 +09:00
}