|
@@ -11,6 +11,7 @@ import { Observable } from 'rxjs';
|
|
|
import { map, filter } from 'rxjs/operators';
|
|
import { map, filter } from 'rxjs/operators';
|
|
|
|
|
|
|
|
import { OldObservation } from '../models/old-observation';
|
|
import { OldObservation } from '../models/old-observation';
|
|
|
|
|
+import { ExportStyle } from '../models/export-style';
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -91,19 +92,62 @@ export class ObservationService extends BaseService {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * Get export styles.
|
|
|
|
|
+ *
|
|
|
|
|
+ *
|
|
|
|
|
+ *
|
|
|
|
|
+ * This method provides access to the full `HttpResponse`, allowing access to response headers.
|
|
|
|
|
+ * To access only the response body, use `getExportStyle()` instead.
|
|
|
|
|
+ *
|
|
|
|
|
+ * This method doesn't expect any request body.
|
|
|
|
|
+ */
|
|
|
|
|
+ getExportStyle$Response(): Observable<StrictHttpResponse<Array<ExportStyle>>> {
|
|
|
|
|
+
|
|
|
|
|
+ const rb = new RequestBuilder(this.rootUrl, ObservationService.RestObservationsPath + 'exportstyle', 'get');
|
|
|
|
|
+
|
|
|
|
|
+ return this.http.request(rb.build({
|
|
|
|
|
+ responseType: 'json',
|
|
|
|
|
+ accept: 'application/json'
|
|
|
|
|
+ })).pipe(
|
|
|
|
|
+ filter((r: any) => r instanceof HttpResponse),
|
|
|
|
|
+ map((r: HttpResponse<any>) => {
|
|
|
|
|
+ return r as StrictHttpResponse<Array<ExportStyle>>;
|
|
|
|
|
+ })
|
|
|
|
|
+ );
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * Get observation.
|
|
|
|
|
+ *
|
|
|
|
|
+ *
|
|
|
|
|
+ *
|
|
|
|
|
+ * This method provides access to only to the response body.
|
|
|
|
|
+ * To access the full response (for headers, for example), `getExportStyle$Response()` instead.
|
|
|
|
|
+ *
|
|
|
|
|
+ * This method doesn't expect any request body.
|
|
|
|
|
+ */
|
|
|
|
|
+ getExportStyle(): Observable<Array<ExportStyle>> {
|
|
|
|
|
+
|
|
|
|
|
+ return this.getExportStyle$Response().pipe(
|
|
|
|
|
+ map((r: StrictHttpResponse<Array<ExportStyle>>) => r.body as Array<ExportStyle>)
|
|
|
|
|
+ );
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
|
|
|
exportObservations(params: {
|
|
exportObservations(params: {
|
|
|
//group_id: number,
|
|
//group_id: number,
|
|
|
sensor_id: number,
|
|
sensor_id: number,
|
|
|
from?: Date;
|
|
from?: Date;
|
|
|
to?: Date;
|
|
to?: Date;
|
|
|
|
|
+ exportStyleId: string;
|
|
|
}): Observable<StrictHttpResponse<string>> {
|
|
}): Observable<StrictHttpResponse<string>> {
|
|
|
const rb = new RequestBuilder(this.rootUrl, ObservationService.RestObservationsPath + 'export', 'get');
|
|
const rb = new RequestBuilder(this.rootUrl, ObservationService.RestObservationsPath + 'export', 'get');
|
|
|
if (params) {
|
|
if (params) {
|
|
|
rb.query('sensor_id', params.sensor_id);
|
|
rb.query('sensor_id', params.sensor_id);
|
|
|
rb.query('from_time', formatDate(params.from, 'yyyy-MM-dd', 'en-US'));
|
|
rb.query('from_time', formatDate(params.from, 'yyyy-MM-dd', 'en-US'));
|
|
|
rb.query('to_time', formatDate(params.to, 'yyyy-MM-dd', 'en-US'));
|
|
rb.query('to_time', formatDate(params.to, 'yyyy-MM-dd', 'en-US'));
|
|
|
- rb.query('style', 'crosstab');
|
|
|
|
|
|
|
+ rb.query('style', params.exportStyleId);
|
|
|
rb.query('nullable', false);
|
|
rb.query('nullable', false);
|
|
|
}
|
|
}
|
|
|
|
|
|