public async Task <ActionResult <IEnumerable <Message> > > GetDeviceSensor(Guid deviceId, string sensor, [FromQuery(Name = "from")] DateTime?from, [FromQuery(Name = "to")] DateTime?to) { var result = await influxDb.QueryAsync(deviceId, sensor, from, to); var processed = this.dataParser.ParseMessages(sensor, result); return(Ok(processed)); }
public async Task <IEnumerable <ChartData> > Get(SignalRFilter filter) { if (filter == null) { throw new ArgumentNullException(nameof(filter)); } var result = await influxDbClient.QueryAsync(filter.DeviceId, filter.Sensor, filter.From); var processed = this.dataParser.ParseMessages(filter.Sensor, result); return(processed); }