namespace Tiobon.Core.Api.Controllers;
///
/// 【牛尾】培训计划(Controller)
///
[Route("api/[controller]")]
[ApiController, GlobalActionFilter]
[Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Ghre)]
public class Ghre_UshioPlanController : BaseController
{
IGhre_PlanServices _planService;
public Ghre_UshioPlanController(IGhre_UshioPlanServices service,
IGhre_PlanServices planService) : base(service)
{
_planService = planService;
}
#region 查询
///
/// 根据条件查询数据
///
/// 条件
/// status
///
[HttpPost, Route("QueryList/{status}")]
public async Task> QueryByStatus([FromBody] QueryBody body, string status)
{
if (status == "Active")
return await _service.QueryFilterPage(body, $"(Status ='Active' OR Status ='Wait')");
else if (status == "Disable")
return await _service.QueryFilterPage(body, null, false);
else
return await _service.QueryFilterPage(body, $"Status ='{status}'");
}
#endregion
#region 状态修改
[HttpPost("UpdateStatus/{status}")]
public async Task UpdateStatus(string status, [FromBody] InsertGhre_PlanInput input)
{
return await _planService.UpdateStatus(input, status);
}
#endregion
#region 新增
[HttpPost("Insert/{status}")]
public async Task> InsertByStatus([FromBody] InsertGhre_UshioPlanInput insertModel, string status)
{
return await _service.InsertByStatus(insertModel, status);
}
#endregion
}