using BPASmartClient.AGV.Feedback;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using Newtonsoft.Json;
namespace BPASmartClient.AgvApi.Controllers
{
[ApiController]
[Route("apicallback/quicktron/[Controller]")]
public class robotjobController : ControllerBase
{
///
/// 搬运任务状态上报
///
///
///
[HttpPost("report")]
public string report(string sign)
{
if (sign != null)
{
try
{
var res = JsonConvert.DeserializeObject(sign);
if (res != null)
{
Factory.GetInstance.SendReport(res);
return "SUCCESS";
}
}
catch (Exception ex)
{
return ex.ToString();
}
}
return "Error";
}
///
/// AGV上下料交互请求接口
///
///
///
[HttpPost("upstreamrequest")]
public string upstreamrequest(string sign)
{
if (sign != null)
{
try
{
var res = JsonConvert.DeserializeObject(sign);
if (res != null)
{
Factory.GetInstance.SendUpstreamrequest(sign);
return "SUCCESS";
}
}
catch (Exception ex)
{
return ex.ToString();
}
}
return "Error";
}
}
}