예제 #1
0
        public async Task <IActionResult> Ping(string device, string info = "")
        {
            if (string.IsNullOrEmpty(device))
            {
                ModelState.AddModelError("device", "Device not set");
                return(BadRequest());
            }

            try
            {
                if (!string.IsNullOrEmpty(info))
                {
                    await deviceRepository.SetInfo(device, info);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            var ping = await pingRepository.Ping(device);

            await blockRepository.ProccessPing(ping);

            return(Ok());
        }
예제 #2
0
 public async Task <string> Ping()
 {
     return(await PingRepository.Ping());
 }