|
@@ -8,6 +8,8 @@ using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
using Newtonsoft.Json.Linq;
|
|
using Newtonsoft.Json.Linq;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
+using Microsoft.Extensions.Configuration;
|
|
|
|
+using LJProxy.Settings;
|
|
|
|
|
|
namespace LJProxy
|
|
namespace LJProxy
|
|
{
|
|
{
|
|
@@ -19,7 +21,7 @@ namespace LJProxy
|
|
InitExcutorMap();
|
|
InitExcutorMap();
|
|
}
|
|
}
|
|
|
|
|
|
- public static void InitExcutorMap()
|
|
|
|
|
|
+ private static void InitExcutorMap()
|
|
{
|
|
{
|
|
excutorManager = new ExcutorManager();
|
|
excutorManager = new ExcutorManager();
|
|
|
|
|
|
@@ -40,5 +42,16 @@ namespace LJProxy
|
|
var result = excutorManager.DoExcute( request, requestState);
|
|
var result = excutorManager.DoExcute( request, requestState);
|
|
return new Tuple<bool, IActionResult>(true, result);
|
|
return new Tuple<bool, IActionResult>(true, result);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public static AppSettings Setting { get; private set; }
|
|
|
|
+
|
|
|
|
+ public static void InitSetting(IConfiguration configuration)
|
|
|
|
+ {
|
|
|
|
+ Setting = new AppSettings();
|
|
|
|
+ Setting.L1SvrCRPUrl = configuration.GetSection("L1SvrCRPUrl")?.Value;
|
|
|
|
+ Setting.L1SvrPROUrl = configuration.GetSection("L1SvrPROUrl")?.Value;
|
|
|
|
+ Setting.ProxyDomainList = configuration.GetSection("ProxyDomainList").GetChildren().Select(c => c.Value).ToList();
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|