示例#1
0
        public async Task <IActionResult> Heartbeat([FromRoute] string deviceId, [FromBody] Location location)
        {
            if (location == null)
            {
                return(BadRequest());
            }

            if (!_deviceService.Exists(deviceId))
            {
                return(BadRequest());
            }

            var heartbeat = new Heartbeat()
            {
                DeviceId  = deviceId,
                Longitude = location.Long,
                Lattitue  = location.Lat
            };

            await _heartbeatService.AddAsync(heartbeat);

            // May return information about medicine reminder
            return(Ok());
        }
示例#2
0
 public void TestExists()
 {
     Assert.IsTrue(_service.Exists(_deviceID));
 }