IStackerStatusController.cs 1.45 KB
using Infrastructure;
using Microsoft.AspNetCore.Mvc;
using WebApp;
using WebRepository;
namespace WebMvc.Areas.Api.Controllers
{
    /// <summary>
    /// 堆垛机运行节点接口
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class IStackerStatusController : ControllerBase
    {
        private readonly IStackerStatusApp _app;

        /// <summary>
        /// 控制器构造函数
        /// </summary>
        /// <param name="unitWork">注入工作单元</param>
        /// <param name="auth">注入授权信息</param>
        /// <param name="context">EF上下文</param>
        public IStackerStatusController(IUnitWork unitWork, IAuth auth, IRepository<Container> Container, BaseDBContext context, IRepository<Inventory> inventory, IRepository<ReceiptDetail> receiptDetail, IRepository<ReceiptHeader> receiptHeader)
        {
            _app = new IStackerStatusApp(unitWork, inventory, Container, auth, context, receiptDetail, receiptHeader);
        }

        /// <summary>
        /// 堆垛机运行节点接口方法
        /// </summary>
        /// <param name="sTKStatusModel">任务回调模型</param>
        /// <returns></returns>
        [HttpPost("SetStackerStatus")]
        [ServiceFilter(typeof(InterfaceLogFilter))]
        public string SetStackerStatus(STKStatusModel sTKStatusModel)
        {
            return JsonHelper.Instance.Serialize(_app.SetStackerStatus(sTKStatusModel));
        }
    }
}