Added service components
[portal.git] / portal-FE-common / src / app / shared / services / userbar / userbar.service.ts
1 import { Injectable } from '@angular/core';
2 import { HttpClient } from '@angular/common/http';
3 import { environment } from 'src/environments/environment';
4
5 @Injectable({
6   providedIn: 'root'
7 })
8 export class UserbarService {
9   refreshCount: number;
10   maxCount: number;
11   apiUrl = environment.api;
12   constructor(public http: HttpClient) {
13     this.refreshCount = 0;
14     this.maxCount = 0;
15   }
16
17   getRefreshCount() {
18     return this.refreshCount;
19   }
20   setRefreshCount(count) {
21     this.refreshCount = count;
22   }
23   setMaxRefreshCount(count) {
24     this.maxCount = count;
25   }
26   decrementRefreshCount() {
27     this.refreshCount = this.refreshCount - 1;
28   }
29
30   getOnlineUserUpdateRate(){
31     return this.http.get(this.apiUrl.onlineUserUpdateRate);
32   }
33 }