using Edge.Core.Domain.FccOrderInfo.Input;
using Edge.Core.Domain.FccOrderInfo.Output;
using FccLite.Web.Services.FccOrderInfo;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;

namespace FccLite.Web.Controller
{
    [Route("qrFueling/order")]
    [ApiController]
    public class OrderInfoController : ControllerBase
    {
        static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
        private readonly IOrderInfoService _orderInfoService;
        public OrderInfoController(IOrderInfoService orderInfoService)
        {
            this._orderInfoService = orderInfoService;
        }

        [HttpPost("getPage")]
        public async Task<IActionResult> GetPage(OrderInfoPageInput orderInfoPageInput)
        {
            logger.Info($"order get page:{JsonConvert.SerializeObject(orderInfoPageInput)}");
            OrderInfoOutput orderInfoOutput = await _orderInfoService.GetPage(orderInfoPageInput);
            return Ok(orderInfoOutput);
        }
    }
}
