using YBEE.EQM.Core;

namespace YBEE.EQM.Application;

/// <summary>
/// 科目基础数据管理服务
/// </summary>
[ApiDescriptionSettings(Name = "base-course")]
[Route("base/course")]
public class CourseAppService : IDynamicApiController
{
    private readonly ICourseService _courseService;
    public CourseAppService(ICourseService courseService)
    {
        _courseService = courseService;
    }

    /// <summary>
    /// 添加科目
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task Add(AddCourseInput input)
    {
        await _courseService.Add(input);
    }
    /// <summary>
    /// 更新科目
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task Update(UpdateCourseInput input)
    {
        await _courseService.Update(input);
    }
    /// <summary>
    /// 软删除科目
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task Del(BaseId input)
    {
        await _courseService.Del(input);
    }
    /// <summary>
    /// 根据ID获取单个科目
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public async Task<CourseOutput> GetById([FromQuery][Required] int id)
    {
        return await _courseService.GetById(id);
    }
    /// <summary>
    /// 获取全部科目完整信息列表
    /// </summary>
    /// <returns></returns>
    public async Task<List<CourseOutput>> GetAllList()
    {
        return await _courseService.GetAllList();
    }
    /// <summary>
    /// 获取全部科目简要信息列表
    /// </summary>
    /// <returns></returns>
    public async Task<List<CourseLiteOutput>> GetAllLiteList()
    {
        return await _courseService.GetAllLiteList();
    }
}
