namespace YBEE.EQM.Application;

/// <summary>
/// TQES报表服务
/// </summary>
[ApiDescriptionSettings(Name = "exam-reporting-tqes")]
[Route("exam/reporting/tqes")]
public class ExamReportingTqesAppService(IExamReportingTqesService examReportingTqesService) : IDynamicApiController
{
    /// <summary>
    /// 根据监测计划ID导出全区优势薄弱
    /// </summary>
    /// <param name="examPlanId"></param>
    /// <returns></returns>
    [AllowAnonymous]
    public async Task<IActionResult> ExportTotalAdvWeak([FromQuery][Required] int examPlanId)
    {
        var (fileName, fileBytes) = await examReportingTqesService.ExportTotalAdvWeak(examPlanId);
        return new FileContentResult(fileBytes, "application/octet-stream")
        {
            FileDownloadName = fileName,
        };
    }
}
