using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using XYY.Common.Standard;
using XYY.Core.Standard.Mvc;
using XYY.Service.Standard.First;
using XYY.Service.Standard.First.Model;

namespace XYY.Api.First.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class TrackDeployController : ApiControllerBase
    {
        private ILadingTrackingService _trackingService;
        public TrackDeployController(ILadingTrackingService trackingService)
        {
            _trackingService = trackingService;
        }

        public async Task<IActionResult> AddFirstTrackMatchRule(Logistics_FirstTrackMatch dto)
        {
            await _trackingService.AddFirstTrackMatchRule(dto);
            return Ok();
        }
        public async Task<IActionResult> UpdateFirstTrackMatchRule(Logistics_FirstTrackMatch dto)
        {
            await _trackingService.UpdateFirstTrackMatchRule(dto);
            return Ok();
        }
        public async Task<IActionResult> DeleteRule(int Id)
        {
            await _trackingService.DeleteFirstTrackMatchRule(Id);
            return Ok();
        }
        public async Task<IActionResult> GetFirstTrackMatchRulesPage(QueryModel model)
        {
            var data = await _trackingService.GetFirstTrackMatchRules(model);
            return Ok(data);
        }
        /// <summary>
        /// 查询51轨迹节点完整时间
        /// </summary>
        /// <returns></returns>
        public async Task<IActionResult> GetNodeTime(NodeTimeData data)
        {
            var result = await _trackingService.GetNodeTime(data);
            return Ok(result);
        }
    }
}
