OpenRouteApiKey ausgezogen

This commit is contained in:
2025-05-30 10:43:28 +02:00
parent ec1174f581
commit bc13cc8903
3 changed files with 10 additions and 9 deletions

View File

@@ -8,5 +8,6 @@
<appSettings>
<add key="OpenWebUIKey" value=""/>
<add key="GetGkvSumApiKey" value=""/>
<add key="DownloadReportApiKey" value=""/>
<add key="DownloadReportApiKey" value=""/>
<add key="OpenrouteServiceApiKey" value="" />
</appSettings>

View File

@@ -302,7 +302,6 @@
<add key="GoogleDistanceMatrixApiKey" value="AIzaSyDZ_tfNwm_YWC9JiCLQtHsd9X2OUUKuL0c" />
<add key="OpenrouteServiceApiUrl" value="https://api.openrouteservice.org/v2/matrix/driving-car" />
<add key="OpenrouteServiceApiUrlGeocode" value="https://api.openrouteservice.org/geocode/search" />
<add key="OpenrouteServiceApiKey" value="5b3ce3597851110001cf62484b0917529e9a4008acda819dc06e47e8" />
<add key="GkvAbrechnungResultFolderPath" value="C:\GkvAbrechnung\Results\" />
<add key="GkvAbrechnungQueueFolderPath" value="C:\GkvAbrechnung\Data\Queue\" />

View File

@@ -1,5 +1,6 @@
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.Core;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -53,23 +54,23 @@ namespace BeWo.Service.ServiceUtils.DistanceCalculator
{
var appSettings = ConfigurationManager.AppSettings;
if (string.IsNullOrEmpty(appSettings["OpenrouteServiceApiUrl"]))
Url = appSettings["OpenrouteServiceApiUrl"];
if (string.IsNullOrEmpty(Url))
{
throw new Exception("OpenrouteServiceApiUrl is not set in AppSettings.");
}
Url = appSettings["OpenrouteServiceApiUrl"];
if (string.IsNullOrEmpty(appSettings["OpenrouteServiceApiKey"]))
Key = MergedConfig.GetSecretSetting("OpenrouteServiceApiKey");
if (string.IsNullOrEmpty(Key))
{
throw new Exception("OpenrouteServiceApiKey is not set in AppSettings.");
}
Key = appSettings["OpenrouteServiceApiKey"];
if (string.IsNullOrEmpty(appSettings["OpenrouteServiceApiUrlGeocode"]))
GeoKey = appSettings["OpenrouteServiceApiUrlGeocode"];
if (string.IsNullOrEmpty(GeoKey))
{
throw new Exception("OpenrouteServiceApiUrlGeocode is not set in AppSettings.");
}
GeoKey = appSettings["OpenrouteServiceApiUrlGeocode"];
}
}
public void RequestMissingData(ref AddressRouteMatrix matrix, IEnumerable<Address> origins, IEnumerable<Address> destinations)