member_webapp/@overflow/target/service/target.service.ts
2018-06-21 20:10:18 +09:00

43 lines
1.3 KiB
TypeScript

import { Injectable } from '@angular/core';
import { RPCService } from '@loafer/ng-rpc';
import { Observable } from 'rxjs';
import { Target } from '@overflow/commons-typescript/model/target';
import { Page, PageParams } from '@overflow/commons-typescript/core/model';
@Injectable()
export class TargetService {
public constructor(
private rpcService: RPCService,
) {
}
public regist(target: Target, probeID: number): Observable<Target> {
return this.rpcService.call<Target>('TargetService.regist', target, probeID);
}
public registAll(targets: Target[], probeID: number): Observable<Target[]> {
return this.rpcService.call<Target[]>('TargetService.registAll', targets, probeID);
}
public remove(id: number, probeID: number) {
return this.rpcService.call('TargetService.remove', id, probeID);
}
public read(id: number): Observable<Target> {
return this.rpcService.call<Target>('TargetService.read', id);
}
public readAllByProbeID(probeID: number): Observable<Target[]> {
return this.rpcService.call<Target[]>('TargetService.readAllByProbeID', probeID);
}
public readAllTargetByProbeID(probeID: number): Observable<Target[]> {
return this.rpcService.call<Target[]>('TargetService.readAllTargetByProbeID', probeID);
}
}