using System.Collections.Generic;
using System.Threading.Tasks;
using Abp.Domain.Services;

namespace YGNT.QuestionLibrary.Core.Chapters.Domain
{
    public interface IChapterTreePathManager : IDomainService
    {
        /// <summary>
        /// 获取章节名称路径
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<string> GetNamePathAsync(long id);

        /// <summary>
        /// 创建章节路径
        /// </summary>
        /// <param name="chapter"></param>
        /// <returns></returns>
        Task<List<ChapterTreePath>> CreateTreePathAsync(Chapter chapter);

        /// <summary>
        /// 获取所有的祖先节点
        /// </summary>
        /// <param name="descendant"></param>
        /// <returns></returns>
        Task<List<ChapterTreePath>> GetAncestorAsync(long descendant);

        /// <summary>
        /// 获取所有的后代节点(包括了自己)
        /// </summary>
        /// <param name="ancestor"></param>
        /// <returns></returns>
        Task<List<ChapterTreePath>> GetDescendantAsync(long ancestor);
    }
}