using System.Net.Http;
using System.Text;
using System.Web.Http;
using Newtonsoft.Json.Linq;
using System.Threading.Tasks;

/////http://127.0.0.1:9981/api/IOrder/InsertOrder

/// <summary>
/// 
/// </summary>
namespace WebApi
{
    /// <summary>
    /// 
    /// </summary>
    [RoutePrefix("api/imes")]
    public class imesController : ApiController
    {
        readonly string headUrl = "api/imes/";

        [HttpPost]
        public async Task<HttpResponseMessage> AGVRequestEnterH1([FromBody] JObject jobj)
        {
            if (jobj == null) jobj = new JObject();
            var result = await ServerController.AGV_To_MES_AgvPass(headUrl + "AGVRequestEnterH1", jobj.ToString(),"H1");
            return new HttpResponseMessage
            {
                Content = new StringContent(result, Encoding.GetEncoding("UTF-8"), "application/json")
            };
        }
        [HttpPost]
        public async Task<HttpResponseMessage> AGVRequestEnterH2([FromBody] JObject jobj)
        {
            if (jobj == null) jobj = new JObject();
            var result = await ServerController.AGV_To_MES_AgvPass(headUrl + "AGVRequestEnterH2", jobj.ToString(), "H2");
            return new HttpResponseMessage
            {
                Content = new StringContent(result, Encoding.GetEncoding("UTF-8"), "application/json")
            };
        }
    }
}
