|
@@ -29,26 +29,6 @@ namespace LJProxy.Controllers
|
|
|
_appSettingModel = appSettingModel.Value;
|
|
|
}
|
|
|
}
|
|
|
- private static ILJClient _PROPool { get; set; }
|
|
|
- private static ILJClient PROPool
|
|
|
- {
|
|
|
- get
|
|
|
- {
|
|
|
- if (_PROPool == null)
|
|
|
- {
|
|
|
- lock (_syncRoot)
|
|
|
- {
|
|
|
- var url = _appSettingModel.L1SvrPROUrl;
|
|
|
- var urlArr = url.Split(':');
|
|
|
- var ip = urlArr[0];
|
|
|
- var port = urlArr[1];
|
|
|
- var creator = new DirectP1ClientCreator(ip, Convert.ToInt32(port));
|
|
|
- _PROPool = new LJClientPool(creator, 1000);
|
|
|
- }
|
|
|
- }
|
|
|
- return _PROPool;
|
|
|
- }
|
|
|
- }
|
|
|
private static ILJClient _pool { get; set; }
|
|
|
private static ILJClient Pool
|
|
|
{
|
|
@@ -58,44 +38,18 @@ namespace LJProxy.Controllers
|
|
|
{
|
|
|
lock (_syncRoot)
|
|
|
{
|
|
|
- var url = _appSettingModel.L1SvrCRPUrl;
|
|
|
+ var url = _appSettingModel.L1SvrUrl;
|
|
|
var urlArr = url.Split(':');
|
|
|
var ip = urlArr[0];
|
|
|
var port = urlArr[1];
|
|
|
var creator = new DirectP1ClientCreator(ip, Convert.ToInt32(port));
|
|
|
- _pool = new LJClientPool(creator, 20);
|
|
|
+ _pool = new LJClientPool(creator, _appSettingModel.ThreadSize);
|
|
|
}
|
|
|
}
|
|
|
return _pool;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //[Route("PRO/{apiName}")]
|
|
|
- //[HttpPost]
|
|
|
- //public string PRO(string apiName, [FromBody] object requestBody)
|
|
|
- //{
|
|
|
- // var rslt = PROPool.DoExcute(apiName, requestBody.ToString());
|
|
|
- // return rslt;
|
|
|
- //}
|
|
|
-
|
|
|
- //[Route("CRP/{apiName}/{**restPath}")]
|
|
|
- //[HttpPost]
|
|
|
- //[HttpGet]
|
|
|
- //public async Task<IActionResult> CRP(string apiName)
|
|
|
- //{
|
|
|
- // string requestBody;
|
|
|
- // using(StreamReader reader = new StreamReader(Request.Body,Encoding.UTF8))
|
|
|
- // {
|
|
|
- // requestBody = await reader.ReadToEndAsync();
|
|
|
- // }
|
|
|
- // var excuteResult = GlobalVar.Excute(apiName, requestBody, Request);
|
|
|
- // if (excuteResult.Item1) return excuteResult.Item2;
|
|
|
- // else
|
|
|
- // {
|
|
|
- // var rslt = CRPPool.DoExcute(apiName, requestBody);
|
|
|
- // return Content(rslt,"application/json");
|
|
|
- // }
|
|
|
- //}
|
|
|
|
|
|
[Route("svr/{apiName}")]
|
|
|
[HttpPost]
|
|
@@ -112,9 +66,5 @@ namespace LJProxy.Controllers
|
|
|
var rslt = Pool.DoExcute(apiName, requestBody);
|
|
|
return Content(rslt, "application/json");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|