diff --git a/src/app/services/data-logs.service.ts b/src/app/services/data-logs.service.ts new file mode 100644 index 0000000000000000000000000000000000000000..cd9be560d7fe1f95432cda6ed3623025ebe4bc60 --- /dev/null +++ b/src/app/services/data-logs.service.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Observable, Subject, from } from 'rxjs'; +import { map, concatMap } from 'rxjs/operators'; +import { HttpClient } from '@angular/common/http'; +import { Resource, IResource, ResourceRO, IResourceFormat } from '../models/resource.model'; +import { APP_CONFIG } from './app-config.service'; + +@Injectable() +export class DataLogsService { + + resourceServiceUrl: string; + limit: number; + pageNumber: number; + sortOptions: { + value: string, + order: string, + }; + + private _searchChangeSubject: Subject<any>; + + constructor( + private _httpClient: HttpClient) { + this.resourceServiceUrl = `${APP_CONFIG.restHeartAggregations.url}uuidToSessionId?avars=`; + this._searchChangeSubject = new Subject<any>(); + this.limit = 10; + this.pageNumber = 1; + } + + uuidToSessionId(uuid): Observable<any[]> { + const query = { uuid : uuid }; + const stringQuery = JSON.stringify(query); + return this._httpClient.get<any[]>(this.resourceServiceUrl + stringQuery).pipe( + map((response) => { + return response; + }), + ); + } +}