DataTransController.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using System.Web.Http;
  2. using DataTransfersLibs.Models;
  3. using GSMarketSys.Service;
  4. using SysBaseLibs;
  5. namespace GSMarketSys.Controllers.TransDataWebApi
  6. {
  7. [RoutePrefix("api")]
  8. public class DataTransController : BaseApiController
  9. {
  10. [HttpPost]
  11. [Route("DataUpload")]
  12. public IHttpActionResult DataUpload()
  13. {
  14. string body= Request.Content.ReadAsStringAsync().Result;
  15. this.LogInfo(body);
  16. var result = TranslationService.Instance.DataUpload(body);
  17. return Json(result);
  18. }
  19. [HttpPost]
  20. [HttpGet]
  21. [Route("Query/Sample")]
  22. public IHttpActionResult GetSampleInfo(AccountInfo poAccount,string userId=null,string password=null)
  23. {
  24. if (poAccount==null)
  25. {
  26. poAccount=new AccountInfo()
  27. {
  28. UserId = userId,
  29. Password = password
  30. };
  31. }
  32. var result = TranslationService.Instance.GetSampleInfo(poAccount);
  33. return Json(result);
  34. }
  35. [HttpPost]
  36. [HttpGet]
  37. [Route("Query/CheckItem")]
  38. public IHttpActionResult GetCheckItemInfo(AccountInfo poAccount, string userId = null, string password = null)
  39. {
  40. if (poAccount == null)
  41. {
  42. poAccount = new AccountInfo()
  43. {
  44. UserId = userId,
  45. Password = password
  46. };
  47. }
  48. var result = TranslationService.Instance.GetCheckItemInfo(poAccount);
  49. return Json(result);
  50. }
  51. [HttpPost]
  52. [HttpGet]
  53. [Route("Query/CheckMethod")]
  54. public IHttpActionResult GetCheckMethodInfo(AccountInfo poAccount, string userId = null, string password = null)
  55. {
  56. if (poAccount == null)
  57. {
  58. poAccount = new AccountInfo()
  59. {
  60. UserId = userId,
  61. Password = password
  62. };
  63. }
  64. var result = TranslationService.Instance.GetCheckMethodInfo(poAccount);
  65. return Json(result);
  66. }
  67. [HttpPost]
  68. [HttpGet]
  69. [Route("Query/District")]
  70. public IHttpActionResult GetDistrictInfo(AccountInfo poAccount, string userId = null, string password = null)
  71. {
  72. if (poAccount == null)
  73. {
  74. poAccount = new AccountInfo()
  75. {
  76. UserId = userId,
  77. Password = password
  78. };
  79. }
  80. var result = TranslationService.Instance.GetDistrictInfo(poAccount);
  81. return Json(result);
  82. }
  83. }
  84. }