|
@@ -49,12 +49,12 @@ namespace LJProxy.Controllers
|
|
|
return _PROPool;
|
|
|
}
|
|
|
}
|
|
|
- private static ILJClient _CRPPool { get; set; }
|
|
|
- private static ILJClient CRPPool
|
|
|
+ private static ILJClient _pool { get; set; }
|
|
|
+ private static ILJClient Pool
|
|
|
{
|
|
|
get
|
|
|
{
|
|
|
- if (_CRPPool == null)
|
|
|
+ if (_pool == null)
|
|
|
{
|
|
|
lock (_syncRoot)
|
|
|
{
|
|
@@ -63,39 +63,58 @@ namespace LJProxy.Controllers
|
|
|
var ip = urlArr[0];
|
|
|
var port = urlArr[1];
|
|
|
var creator = new DirectP1ClientCreator(ip, Convert.ToInt32(port));
|
|
|
- _CRPPool = new LJClientPool(creator, 20);
|
|
|
+ _pool = new LJClientPool(creator, 20);
|
|
|
}
|
|
|
}
|
|
|
- return _CRPPool;
|
|
|
+ return _pool;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- [Route("PRO/{apiName}")]
|
|
|
- [HttpPost]
|
|
|
- public string PRO(string apiName, [FromBody] object requestBody)
|
|
|
- {
|
|
|
- var rslt = PROPool.DoExcute(apiName, requestBody.ToString());
|
|
|
- return rslt;
|
|
|
- }
|
|
|
+ //[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}")]
|
|
|
+ //[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]
|
|
|
[HttpGet]
|
|
|
- public async Task<IActionResult> CRP(string apiName)
|
|
|
- {
|
|
|
+ public async Task<IActionResult> Svr(string apiName)
|
|
|
+ {
|
|
|
string requestBody;
|
|
|
- using(StreamReader reader = new StreamReader(Request.Body,Encoding.UTF8))
|
|
|
+ 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");
|
|
|
- }
|
|
|
+ //var excuteResult = GlobalVar.Excute(apiName, requestBody, Request);
|
|
|
+ //if (excuteResult.Item1) return excuteResult.Item2;
|
|
|
+ var rslt = Pool.DoExcute(apiName, requestBody);
|
|
|
+ return Content(rslt, "application/json");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|