using Hotline.Application.Jobs;
using Hotline.Orders;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Hotline.Api.Controllers
{
    public class CorsJobController: BaseController
    {
        private readonly IOrderDomainService _orderDomainService;
        public CorsJobController(IOrderDomainService orderDomainService)
        {
            _orderDomainService = orderDomainService;
        }

        /// <summary>
        /// 定时发送超期短信
        /// 0 30 09,14 * * ?
        /// </summary>
        /// <returns></returns>
        [HttpGet("send-overtime-sms")]
        [AllowAnonymous]
        public async Task SendOverTimeSms()
        {
            await _orderDomainService.SendOverTimeSms(HttpContext.RequestAborted);
        }
    }
}
