namespace Tiobon.Core.Api.Controllers;

/// <summary>
/// 学分记录(Controller)
/// </summary>
[Route("api/[controller]")]
[ApiController, GlobalActionFilter]
[Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Ghre)]
public class Ghre_CreditPointController : BaseController<IGhre_CreditPointServices, Ghre_CreditPoint, Ghre_CreditPointDto, InsertGhre_CreditPointInput, EditGhre_CreditPointInput>
{
    public Ghre_CreditPointController(IGhre_CreditPointServices service) : base(service)
    {
    }

    #region 查询明细数据
    /// <summary>
    /// 查询明细数据
    /// </summary>
    /// <param name="body">body</param>
    /// <returns></returns>
    [HttpPost, Route("QueryTotal")]
    public async Task<ServicePageResult<Ghre_CreditPointTotal>> QueryTotal([FromBody] QueryBody body)
    {
        return await _service.QueryTotal(body);
    }



    #endregion

    #region 根据工号查询学分明细
    /// <summary>
    /// 根据工号查询学分明细
    /// </summary>
    /// <param name="body"></param>
    /// <param name="staffId">员工ID</param>
    /// <returns></returns>
    [HttpPost("QueryDetail/{staffId}")]
    public async Task<ServicePageResult<Ghre_CreditPointDetail>> QueryDetail([FromBody] QueryBody body, string staffId)
    {
        return await _service.QueryDetail(body, staffId);
    }
    #endregion
}