using System.Web.Http; using DataTransfersLibs.Models; using GSMarketSys.Service; using SysBaseLibs; namespace GSMarketSys.Controllers.TransDataWebApi { [RoutePrefix("api")] public class DataTransController : BaseApiController { [HttpPost] [Route("DataUpload")] public IHttpActionResult DataUpload() { string body= Request.Content.ReadAsStringAsync().Result; this.LogInfo(body); var result = TranslationService.Instance.DataUpload(body); return Json(result); } [HttpPost] [HttpGet] [Route("Query/Sample")] public IHttpActionResult GetSampleInfo(AccountInfo poAccount,string userId=null,string password=null) { if (poAccount==null) { poAccount=new AccountInfo() { UserId = userId, Password = password }; } var result = TranslationService.Instance.GetSampleInfo(poAccount); return Json(result); } [HttpPost] [HttpGet] [Route("Query/CheckItem")] public IHttpActionResult GetCheckItemInfo(AccountInfo poAccount, string userId = null, string password = null) { if (poAccount == null) { poAccount = new AccountInfo() { UserId = userId, Password = password }; } var result = TranslationService.Instance.GetCheckItemInfo(poAccount); return Json(result); } [HttpPost] [HttpGet] [Route("Query/CheckMethod")] public IHttpActionResult GetCheckMethodInfo(AccountInfo poAccount, string userId = null, string password = null) { if (poAccount == null) { poAccount = new AccountInfo() { UserId = userId, Password = password }; } var result = TranslationService.Instance.GetCheckMethodInfo(poAccount); return Json(result); } [HttpPost] [HttpGet] [Route("Query/District")] public IHttpActionResult GetDistrictInfo(AccountInfo poAccount, string userId = null, string password = null) { if (poAccount == null) { poAccount = new AccountInfo() { UserId = userId, Password = password }; } var result = TranslationService.Instance.GetDistrictInfo(poAccount); return Json(result); } } }