member_webapp/@overflow/infra/service/infra.service.ts
2018-06-12 14:45:21 +09:00

35 lines
1.1 KiB
TypeScript

import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { RPCService } from '@loafer/ng-rpc';
import { Infra } from '@overflow/commons-typescript/model/infra';
import { Domain } from '@overflow/commons-typescript/model/domain';
import { Page, PageParams } from '@overflow/commons-typescript/core/model';
@Injectable()
export class InfraService {
public constructor(
private rpcService: RPCService,
) {
}
// public readAllByDomain(domain: Domain, pageParams: PageParams): Observable<Page> {
// return this.rpcService.call('InfraService.readAllByDomain', domain, pageParams);
// }
public readAllByProbeID(probeID: number, pageParams: PageParams): Observable<Page<Infra>> {
return this.rpcService.call<Page<Infra>>('InfraService.readAllByProbeID', probeID, pageParams);
}
public read(id: string): Observable<Infra> {
return this.rpcService.call<Infra>('InfraService.read', id);
}
public readAllInfraZoneByProbeID(probeID: number): Observable<Infra[]> {
return this.rpcService.call<Infra[]>('InfraService.readAllInfraZoneByProbeID', probeID);
}
}