Esempio n. 1
0
        public ActionResult <string> RegisterReading(string panelId, [FromBody] double wattage)
        {
            var time = DateTime.UtcNow;

            var serviceResult = _panelService.RegisterReading(panelId, time, wattage);

            if (serviceResult.ResponseCode != ResponseCode.Success)
            {
                return(BadRequest(serviceResult.Error));
            }

            return(Ok(serviceResult.Result.Id));
        }