|
|
@@ -11,19 +11,25 @@ import { Injectable } from '@angular/core';
|
|
11
|
11
|
@Injectable()
|
|
12
|
12
|
export class VespotServiceProvider {
|
|
13
|
13
|
|
|
|
14
|
+ URL: string;
|
|
|
15
|
+
|
|
14
|
16
|
constructor(public http: HttpClient) {
|
|
|
17
|
+ this.URL = 'http://api.vespot.com';
|
|
15
|
18
|
}
|
|
16
|
19
|
|
|
17
|
20
|
getDevices(auth) {
|
|
18
|
|
- return this.http.get('http://api.vespot.com/devices', {headers: new HttpHeaders().set('Authorization', 'Basic ' + btoa(auth))});
|
|
|
21
|
+ return this.http.get(this.URL + '/devices', {headers: new HttpHeaders().set('Authorization', 'Basic ' + btoa(auth))});
|
|
19
|
22
|
}
|
|
20
|
23
|
|
|
21
|
24
|
getDeviceById(auth, deviceId) {
|
|
22
|
|
- return this.http.get('http://api.vespot.com/devices?id=' + deviceId, {headers: new HttpHeaders().set('Authorization', 'Basic ' + btoa(auth))});
|
|
|
25
|
+ return this.http.get(this.URL + '/devices?id=' + deviceId, {headers: new HttpHeaders().set('Authorization', 'Basic ' + btoa(auth))});
|
|
23
|
26
|
}
|
|
24
|
27
|
|
|
25
|
28
|
getPositionById(auth, positionId) {
|
|
26
|
|
- return this.http.get('http://api.vespot.com/positions?positionId=' + positionId, {headers: new HttpHeaders().set('Authorization', 'Basic ' + btoa(auth))});
|
|
|
29
|
+ return this.http.get(this.URL + '/positions?positionId=' + positionId, {headers: new HttpHeaders().set('Authorization', 'Basic ' + btoa(auth))});
|
|
27
|
30
|
}
|
|
28
|
31
|
|
|
|
32
|
+ getPositionByDeviceId(auth, deviceId) {
|
|
|
33
|
+ return this.http.get(this.URL + '/positions/lastdeviceposition?deviceId=' + deviceId, {headers: new HttpHeaders().set('Authorization', 'Basic ' + btoa(auth))});
|
|
|
34
|
+ }
|
|
29
|
35
|
}
|