namespace YBEE.EQM.Application;

/// <summary>
/// 导出成绩服务
/// </summary>
/// <param name="examScoreExportService"></param>
public class ExamScoreExportAppService(IExamScoreExportService examScoreExportService) : IDynamicApiController
{
    /// <summary>
    /// 导出TQES输入文件
    /// </summary>
    /// <param name="input">监测计划ID</param>
    /// <returns></returns>
    public async Task<IActionResult> ExportTqesFile(ExamScoreExportTqesFileInput input)
    {
        var (fileName, fileBytes) = await examScoreExportService.ExportTqesFile(input);
        return new FileContentResult(fileBytes, "application/octet-stream")
        {
            FileDownloadName = fileName,
        };
    }
}
