using LifePayment.Application.Contracts;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Uow;
using ZeroD.Util;

namespace LifePayment.HttpApi
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    [Authorize]
    public class OperateHistoryController : AbpController
    {
        private readonly IOperateHistoryService _operateHistoryService;
        public OperateHistoryController(
               IOperateHistoryService operateHistoryService)
        {
            _operateHistoryService = operateHistoryService;
        }
        /// <summary>
        /// 查询日志
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [UnitOfWork(IsDisabled = true)]
        public async Task<PageOutput<OperateHistoryDto>> GetOperateHistoryByRelationId(GetOperateHistoryInput input)
        {
            return await _operateHistoryService.GetOperateHistoryByRelationId(input);
        }

        /// <summary>
        /// 根据type查询日志
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [UnitOfWork(IsDisabled = true)]
        public async Task<PageOutput<OperateHistoryDto>> GetOperateHistoryByType(QueryOperateHistoryByTypeInput input)
        {
            return await _operateHistoryService.GetOperateHistoryByType(input);
        }
    }
}