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

namespace YGNT.QuestionLibrary.Chapters
{
    /// <summary>
    /// 章节管理
    /// </summary>
    public interface IChapterAppService : IApplicationService
    {
        /// <summary>
        /// 查询章节列表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        Task<PagedResultDto<ChapterItemDto>> GetListAsync(SearchChapterInputDto search);

        /// <summary>
        /// 获取章节详细信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ChapterDto> GetInfoAsync(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(CreateChapterDto create);

        /// <summary>
        /// 修改章节信息
        /// </summary>
        /// <param name="id"></param>
        /// <param name="update"></param>
        /// <returns></returns>
        Task UpdateAsync(long id, UpdateChapterDto update);

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

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