using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using XYY.Common.Standard;
using XYY.Core.Standard.Mvc;
using XYY.Model.Standard.Charging;
using XYY.Service.Standard.Finance.Charging.Base;
using XYY.Service.Standard.Finance.Charging.CustomerOrderFee;
using XYY.Service.Standard.Finance.Charging.Dto;

namespace XYY.Api.Finance.Charges.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ChargeLogController : ApiControllerBase
    {
        private IChargeLogService _chargeLogService;
        public ChargeLogController(IChargeLogService chargeLogService)
        {
            _chargeLogService = chargeLogService;
        }

        public async Task<long> SaveLog(Finance_Charge_Log log)
        {
            long id = await _chargeLogService.SaveChargeLog(log);
            return id;
        }

        [HttpPost]
        public async Task<IActionResult> QueryData(QueryModel queryModel)
        {
            var data = await _chargeLogService.QueryData(queryModel);
            return Ok(data);
        }

        [HttpPost]
        public async Task<IActionResult> Retry(RetryChargingParam param)
        {

            var data = await _chargeLogService.RetryCharge(param);
            return Ok(data);
        }

    }
}
