예제 #1
0
 public async Task <IActionResult> GetExposureConfiguration(bool r1_2, CancellationToken cancellationToken)
 {
     try
     {
         _logger.LogInformation("GetExposureConfiguration endpoint called");
         if (r1_2 == false)
         {
             var exposureConfiguration = _exposureConfigurationService.GetConfiguration();
             _logger.LogInformation("V1.2 ExposureConfiguration fetched successfully");
             return(Ok(exposureConfiguration));
         }
         else
         {
             var exposureConfiguration = _exposureConfigurationService.GetConfigurationR1_2();
             _logger.LogInformation("ExposureConfiguration fetched successfully");
             return(Ok(exposureConfiguration));
         }
     }
     catch (ArgumentException e)
     {
         _logger.LogError("Error: " + e);
         return(BadRequest("Invalid exposure configuration or uninitialized"));
     }
     catch (Exception e)
     {
         _logger.LogError("Error returning config:" + e);
         return(StatusCode(500));
     }
 }
 public ActionResult GetExposureConfiguration()
 {
     try
     {
         _logger.LogInformation("GetExposureConfiguration endpoint called");
         var exposureConfiguration = _exposureConfigurationService.GetConfigurationR1_2();
         _logger.LogInformation("ExposureConfiguration fetched successfully");
         return(Ok(exposureConfiguration));
     }
     catch (ArgumentException e)
     {
         _logger.LogError("Error: " + e);
         return(BadRequest("Invalid exposure configuration or uninitialized"));
     }
     catch (Exception e)
     {
         _logger.LogError("Error returning config:" + e);
         return(StatusCode(500));
     }
 }