39 lines
784 B
TypeScript
39 lines
784 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 { Target } from '../model';
|
||
|
import { Domain } from '../../domain/model';
|
||
|
|
||
|
|
||
|
@Injectable()
|
||
|
export class TargetService {
|
||
|
|
||
|
public constructor(
|
||
|
private rpcService: RPCService,
|
||
|
) {
|
||
|
|
||
|
}
|
||
|
|
||
|
public readAllByDomain(domain: Domain): Observable<Target[]> {
|
||
|
const body = {
|
||
|
domain: domain,
|
||
|
};
|
||
|
|
||
|
return this.rpcService.call('TargetService.readAllByDomain', domain);
|
||
|
}
|
||
|
|
||
|
// public readAllByProbe(domain: Domain): Observable<Target[]> {
|
||
|
// const body = {
|
||
|
// domain: domain,
|
||
|
// };
|
||
|
|
||
|
// return this.rpcService.call('TargetService.readAllByDomain', domain);
|
||
|
// }
|
||
|
|
||
|
|
||
|
}
|