using Hotline.Application.Bigscreen;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Hotline.Api.Controllers.Bigscreen
{
	public class SeatController : BaseController
	{
		private readonly ISeatStateDataService _seatStateDataService;

		public SeatController(ISeatStateDataService seatStateDataService) {
			_seatStateDataService = seatStateDataService;
		}

		/// <summary>
		/// 首次进入大屏获取数据
		/// </summary>
		/// <returns></returns>
		[AllowAnonymous]
		[HttpGet("base_data")]
		public async Task<object> GetSeatStateData() {
			var call24 = await _seatStateDataService.GetCall24(HttpContext.RequestAborted);
			var callTop10 = await _seatStateDataService.GetCallTop10(HttpContext.RequestAborted);
			var callList =await _seatStateDataService.GetCallList(HttpContext.RequestAborted);
			var callAverage = await _seatStateDataService.GetCallAverage(HttpContext.RequestAborted);
			return new object[] { call24, callTop10, callList, callAverage };
		}
	}
}
