using YBEE.EQM.Core;

namespace YBEE.EQM.Application;

/// <summary>
/// 学校班级信息管理服务
/// </summary>
[ApiDescriptionSettings(Name = "base-school-class")]
[Route("base/school/class")]
public class SchoolClassAppService : IDynamicApiController
{
    private readonly ISchoolClassService _schoolClassService;
    public SchoolClassAppService(ISchoolClassService schoolClassService)
    {
        _schoolClassService = schoolClassService;
    }

    /// <summary>
    /// 添加学校班级
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task Add(AddSchoolClassInput input)
    {
        await _schoolClassService.Add(input);
    }
    /// <summary>
    /// 批量添加学校班级
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task BatchAdd(BatchAddSchoolClassInput input)
    {
        await _schoolClassService.BatchAdd(input);
    }
    /// <summary>
    /// 根据ID获取学校班级信息
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public async Task<SchoolClassOutput> GetById([FromQuery][Required] long id)
    {
        return await _schoolClassService.GetById(id);
    }
    /// <summary>
    /// 根据级获取学校班级列表
    /// </summary>
    /// <param name="gradeBeginYear"></param>
    /// <returns></returns>
    public async Task<List<SchoolClassOutput>> GetListByGradeBeginYear([FromQuery][Required] short gradeBeginYear)
    {
        return await _schoolClassService.GetListByGradeBeginYear(gradeBeginYear);
    }
    /// <summary>
    /// 分页查询班级列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task<PageResult<SchoolClassOutput>> QueryPageList(SchoolClassPageInput input)
    {
        return await _schoolClassService.QueryPageList(input);
    }
}
