Пример #1
0
 public ActionResult <string> getCoordinates(string coordinates)
 {
     try
     {
         /// <summary>Use the name of a city like "New York", or city and country like "New York:USA"</summary>
         ApiResponse response = terminal.Execute("coordinates", coordinates);
         return(Ok(response.ToString()));
     }
     catch (Exception e)
     {
         return(BadRequest(e));
     }
 }
Пример #2
0
 public ActionResult <string> getWeather(string place)
 {
     try
     {
         ApiResponse response = terminal.Execute("location", place);
         _logger.LogInformation($"Successful request: {place}");
         return(Ok(response.ToString()));
     }
     catch (Exception e)
     {
         _logger.LogError($"EXCEPTION: {e}");
         return(BadRequest($"Invalid parameter: {place}"));
     }
 }