Beispiel #1
0
        public IHttpActionResult AtMeter(string meterId)
        {
            if (!_meteredSpacesService.Exists(meterId))
            {
                return(NotFound());
            }

            var lifetime = _sensorEventsService.GetDefaultLifetime();

            if (lifetime == null)
            {
                lifetime = _sensorEventsService.GetMaxLifetime();
            }

            var events = _sensorEventsService.GetViewModelsSince(lifetime.Since, meterId);

            return(Ok(events));
        }
Beispiel #2
0
        public IHttpActionResult Default()
        {
            var lifetime = _sensorEventsService.GetDefaultLifetime();

            if (lifetime == null)
            {
                lifetime = _sensorEventsService.GetMaxLifetime();
            }

            return(Ok(lifetime));
        }