namespace Tiobon.Core.Api.Controllers;

/// <summary>
/// 必选修规则结果(Controller)
/// </summary>
[Route("api/[controller]")]
[ApiController, GlobalActionFilter]
[Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Ghre)]
public class Ghre_StudyRuleResultController : BaseController<IGhre_StudyRuleResultServices, Ghre_StudyRuleResult, Ghre_StudyRuleResultDto, InsertGhre_StudyRuleResultInput, EditGhre_StudyRuleResultInput>
{
    public Ghre_StudyRuleResultController(IGhre_StudyRuleResultServices service) : base(service)
    {
    }


    #region 根据条件查询数据
    /// <summary>
    /// 根据条件查询数据
    /// </summary>
    /// <param name="RuleId">RuleId</param>
    /// <param name="body">条件</param>
    /// <returns></returns>
    [HttpPost, Route("QueryByRuleId/{RuleId}")]
    public async Task<ServicePageResult<Ghre_StudyRuleResultDto>> Query(long RuleId, [FromBody] QueryBody body)
    {
        return await _service.QueryFilterPage(body, $"StudyRuleId='{RuleId}'");
    }

    #endregion
}