using YBEE.EQM.Core;

namespace YBEE.EQM.Application;

/// <summary>
/// 试卷小题管理服务
/// </summary>
public class ExamPaperQuestionMinorAppService : IDynamicApiController
{
    private readonly IExamPaperQuestionMinorService _examPaperQuestionMinorService;

    public ExamPaperQuestionMinorAppService(IExamPaperQuestionMinorService examPaperQuestionMinorService)
    {
        _examPaperQuestionMinorService = examPaperQuestionMinorService;
    }

    /// <summary>
    /// 添加
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task Add(AddExamPaperQuestionMinorInput input)
    {
        await _examPaperQuestionMinorService.Add(input);
    }
    /// <summary>
    /// 更新
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task Update(UpdateExamPaperQuestionMinorInput input)
    {
        await _examPaperQuestionMinorService.Update(input);
    }
    /// <summary>
    /// 批量更新
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task BatchUpdate(BatchUpdateExamPaperQuestionMinorInput input)
    {
        await _examPaperQuestionMinorService.BatchUpdate(input);
    }
    /// <summary>
    /// 删除
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task Del(BaseId input)
    {
        await _examPaperQuestionMinorService.Del(input);
    }

    /// <summary>
    /// 根据试卷ID获取小题列表
    /// </summary>
    /// <param name="examPaperId"></param>
    /// <returns></returns>
    public async Task<List<ExamPaperQuestionMinorOutput>> GetListByExamPaperId([FromQuery][Required] int examPaperId)
    {
        return await _examPaperQuestionMinorService.GetListByExamPaperId(examPaperId);
    }
}
