IHeightWeghtLocationGetController.cs 1.4 KB
using Infrastructure;
using Microsoft.AspNetCore.Mvc;
using WebApp;
using WebRepository;

namespace WebMvc.Areas.Api.Controllers
{
    /// <summary>
    /// WCS根据高度和重量请求对应仓位接口
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class IHeightWeghtLocationGetController : ControllerBase
    {
        private readonly IHeightWeghtLocationGetApp _app;

        /// <summary>
        /// 控制器构造函数
        /// </summary>
        /// <param name="unitWork">注入工作单元</param>
        /// <param name="auth">注入授权信息</param>
        /// <param name="context">EF上下文</param>
        public IHeightWeghtLocationGetController(IUnitWork unitWork, IAuth auth, BaseDBContext context)
        {
            _app = new IHeightWeghtLocationGetApp(unitWork, auth, context);
        }

        /// <summary>
        /// 仓位请求接口方法
        /// </summary>
        /// <param name="taskno">任务号</param>
        /// <param name="height">高度</param>
        /// <param name="weight">重量</param>
        /// <returns></returns>
        [HttpPost("GetHeightLocation")]
        [ServiceFilter(typeof(InterfaceLogFilter))]
        public string GetHeightLocation(string taskno,decimal height,decimal weight)
        {
            return JsonHelper.Instance.Serialize(_app.GetHeightLocation(taskno, height, weight));
        }

    }
}