Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame^] | 1 | import { Injectable } from '@angular/core'; |
| 2 | import { HttpClient } from '@angular/common/http'; |
| 3 | import 'rxjs/add/operator/map'; |
| 4 | import { Constants } from '../shared/utils/constants'; |
| 5 | import { VidConfiguration } from '../configuration/vid.configuration'; |
| 6 | |
| 7 | @Injectable() |
| 8 | export class SdcService { |
| 9 | |
| 10 | |
| 11 | constructor (private http: HttpClient) { |
| 12 | } |
| 13 | |
| 14 | public getServicesModels(): any { |
| 15 | let pathQuery: string = Constants.Path.SERVICES_DIST_STATUS_PATH + VidConfiguration.ASDC_MODEL_STATUS; |
| 16 | |
| 17 | if ( VidConfiguration.ASDC_MODEL_STATUS === Constants.Status.ALL) { |
| 18 | pathQuery = Constants.Path.SERVICES_PATH; |
| 19 | } |
| 20 | |
| 21 | return this.http.get(pathQuery); |
| 22 | } |
| 23 | |
| 24 | getService(uuid: string) { |
| 25 | return this.http.get(Constants.Path.SERVICES_PATH + uuid); |
| 26 | } |
| 27 | |
| 28 | } |