12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using LJLib.Client;
- using LJLib.Net.SPI.Client;
- using LJLib.Net.SPI.Com;
- using LJProxy.Models;
- using LJProxy.Settings;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.Extensions.Options;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- using Newtonsoft.Json;
- using System.IO;
- using System.Text;
- using Newtonsoft.Json.Linq;
- using LJProxy.Services;
- namespace LJProxy.Controllers
- {
- [Route("api/[controller]")]
- [ApiController]
- public class L1SvrController : Controller
- {
- private static object _syncRoot = new object();
- public static AppSettings _appSettingModel;
- private LJClientPoolService _ljClient;
- public L1SvrController(LJClientPoolService ljClient)
- {
- _ljClient = ljClient;
- }
- [Route("svr/{apiName}")]
- [HttpPost]
- [HttpGet]
- public async Task<IActionResult> Svr(string apiName)
- {
- string requestBody;
- using (StreamReader reader = new StreamReader(Request.Body, Encoding.UTF8))
- {
- requestBody = await reader.ReadToEndAsync();
- }
- var rslt = _ljClient.Pool.DoExcute(apiName, requestBody);
- return Content(rslt, "application/json");
- }
- }
- }
|