using YBEE.EQM.Core;

namespace YBEE.EQM.Application;

/// <summary>
/// 高中模拟划线计划管理服务
/// </summary>
[ApiDescriptionSettings(Name = "ncee-plan")]
[Route("ncee/plan")]
public class NceePlanAppService : IDynamicApiController
{
    private readonly INceePlanService _nceePlanService;

    public NceePlanAppService(INceePlanService nceePlanService)
    {
        _nceePlanService = nceePlanService;
    }

    #region 创建更新
    /// <summary>
    /// 添加计划
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task Add(AddNceePlanInput input)
    {
        await _nceePlanService.Add(input);
    }
    /// <summary>
    /// 更新计划
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task Update(UpdateNceePlanInput input)
    {
        await _nceePlanService.Update(input);
    }
    /// <summary>
    /// 删除计划
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task Del(BaseId input)
    {
        await _nceePlanService.Del(input);
    }
    #endregion

    #region 状态变更
    /// <summary>
    /// 开始监测
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task Start(BaseId input)
    {
        await _nceePlanService.Start(input);
    }
    /// <summary>
    /// 结束监测
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task Stop(BaseId input)
    {
        await _nceePlanService.Stop(input);
    }
    /// <summary>
    /// 取消监测
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task Cancel(BaseId input)
    {
        await _nceePlanService.Cancel(input);
    }
    #endregion

    #region 查询统计
    /// <summary>
    /// 根据ID获取计划
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public async Task<NceePlanOutput> GetById(int id)
    {
        return await _nceePlanService.GetById(id);
    }
    /// <summary>
    /// 分页查询计划列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task<PageResult<NceePlanOutput>> QueryPageList(NceePlanPageInput input)
    {
        return await _nceePlanService.QueryPageList(input);
    }
    /// <summary>
    /// 获取我的单据状态数量
    /// </summary>
    /// <returns></returns>
    public async Task<List<StatusCount>> QueryStatusCount(NceePlanPageInput input)
    {
        return await _nceePlanService.QueryStatusCount(input);
    }
    #endregion
}
