using YBEE.EQM.Core;

namespace YBEE.EQM.Application;

/// <summary>
/// 年级信息服务
/// </summary>
[ApiDescriptionSettings(Name = "base-grade")]
[Route("base/grade")]
public class GradeAppService : IDynamicApiController
{
    private readonly IGradeService _gradeService;
    public GradeAppService(IGradeService gradeService)
    {
        _gradeService = gradeService;
    }

    /// <summary>
    /// 根据ID获取年级信息
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public async Task<GradeOutput> GetById([FromQuery][Required] int id)
    {
        return await _gradeService.GetById(id);
    }
    /// <summary>
    /// 根据学段获取年级列表
    /// </summary>
    /// <param name="stage"></param>
    /// <returns></returns>
    public async Task<List<GradeOutput>> GetListByEducationStage([FromQuery][Required] EducationStage stage)
    {
        return await _gradeService.GetListByEducationStage(stage);
    }
    /// <summary>
    /// 根据学期和学段获取年级年份
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task<List<GradeYearOutput>> QueryGradeYearList(QueryGradeYearInput input)
    {
        return await _gradeService.QueryGradeYearList(input);
    }
    /// <summary>
    /// 获取全部年级列表
    /// </summary>
    /// <returns></returns>
    public async Task<List<GradeOutput>> GetAllList()
    {
        return await _gradeService.GetAllList();
    }
}
