TestController.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using LJLib.Client;
  2. using Microsoft.AspNetCore.Http.Extensions;
  3. using Microsoft.AspNetCore.Mvc;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.IO;
  7. using System.Linq;
  8. using System.Net.Http;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace LJProxy.Controllers
  12. {
  13. [Route("api/[controller]")]
  14. public class TestController : Controller
  15. {
  16. private readonly IHttpClientFactory _clientFactory;
  17. public TestController(IHttpClientFactory clientFactory)
  18. {
  19. _clientFactory = clientFactory;
  20. }
  21. //[HttpGet]
  22. //[Route("test")]
  23. //public string test()
  24. //{
  25. // var creator = new DirectP1ClientCreator("192.168.0.92", Convert.ToInt32("7940"));
  26. // var pool = new LJClientPool(creator, 20);
  27. // var loginObj = new
  28. // {
  29. // accountname = "CRP1",
  30. // userid = "admin",
  31. // psw = "longjoe",
  32. // clientType = 10
  33. // };
  34. // var result=pool.DoExcute("ClientLogin", Newtonsoft.Json.JsonConvert.SerializeObject(loginObj));
  35. // return result;
  36. //}
  37. }
  38. }