using System.Collections.Generic;
using System.Threading.Tasks;
using Abp.Application.Services;
using Abp.Application.Services.Dto;
using YGNT.Infrastructure.Model;
using YGNT.QuestionLibrary.Core.Models;
using YGNT.QuestionLibrary.KnowledgePoints.Dto;

namespace YGNT.QuestionLibrary.KnowledgePoints
{
    /// <summary>
    /// 知识点
    /// </summary>
    public interface IKnowledgePointAppService : IApplicationService
    {
        /// <summary>
        /// 查询知识点列表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        Task<PagedResultDto<KnowledgeTreePointDto>> GetListAsync(SearchKnowledgePointInputDto search);


        /// <summary>
        /// 查询知识点详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<KnowledgeTreePointDto> GetOneAsync(long id);

        /// <summary>
        /// 获取所有的子知识点(包括自己)
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<List<KnowledgePointDto>> GetAllChildKnowledgePointAsync(long id);

        /// <summary>
        /// 获取知识点名称路径
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<string> GetNamePathAsync(long id);

        /// <summary>
        /// 创建新知识点
        /// </summary>
        /// <param name="create"></param>
        /// <returns></returns>
        Task<long> CreateAsync(CreateKnowledgePointDto create);

        /// <summary>
        /// 修改知识点
        /// </summary>
        /// <param name="id"></param>
        /// <param name="update"></param>
        /// <returns></returns>
        Task UpdateAsync(long id, UpdateKnowledgePointDto update);

        /// <summary>
        /// 排序
        /// </summary>
        /// <param name="sort"></param>
        /// <returns></returns>
        Task Sort(SortDto<long> sort);

        /// <summary>
        /// 移动知识点节点
        /// </summary>
        /// <param name="id">要移动的知识点Id</param>
        /// <param name="targetParentId">目标知识点(父节点)</param>
        /// <returns></returns>
        Task MoveTo(long id, long targetParentId);

        /// <summary>
        /// 删除知识点
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task DeleteAsync(long id);
        /// <summary>
        /// 同步知识点
        /// </summary>
        /// <returns></returns>
        Task DataSyncAsync();
    }
}