namespace Tiobon.Core.Api.Controllers;

/// <summary>
/// 课程(Controller)
/// </summary>
[Route("api/[controller]")]
[ApiController, GlobalActionFilter]
[Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Ghre)]
public class Ghre_CourseController : BaseController<IGhre_CourseServices, Ghre_Course, Ghre_CourseDto, InsertGhre_CourseInput, EditGhre_CourseInput>
{
    public Ghre_CourseController(IGhre_CourseServices service) : base(service)
    {
    }

    #region 查询
    /// <summary>
    /// 根据条件查询数据
    /// </summary>
    /// <param name="status">status</param>
    /// <param name="body">条件</param>
    /// <returns></returns>
    [HttpPost, Route("QueryList/{status}")]
    public async Task<ServicePageResult<Ghre_CourseDto>> QueryList(string status, [FromBody] QueryBody body)
    {
        return await _service.QueryList(body, status);
    }

    [HttpPost, Route("QueryDeptID/{StaffID}")]
    public async Task<ServiceResult<int>> QueryDeptID(int StaffID)
    {
        return await _service.QueryDeptID(StaffID);
    }

    [HttpPost, Route("GetSelect")]
    public async Task<ServiceResult<CommonSelect>> QueryTeacher(long? linkId)
    {
        return await _service.QueryTeacher(linkId);
    }

    #endregion

    #region 更新 
    [HttpPost("UpdateStatus/{status}")]
    public async Task<ServiceResult> UpdateStatus(string status, [FromBody] long[] ids)
    {
        return await _service.UpdateStatus(ids, status);
    }
    #endregion 
}