using System.Threading.Tasks;
using Abp.Application.Services;
using Abp.Application.Services.Dto;
using YGNT.QuestionLibrary.Textbooks.Dto;

namespace YGNT.QuestionLibrary.Textbooks
{
    /// <summary>
    /// 教材
    /// </summary>
    public interface ITextbookAppService : IApplicationService
    {
        /// <summary>
        /// 获取教材列表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        Task<PagedResultDto<TextbookDto>> GetListAsync(SearchTextbookInputDto search);

        /// <summary>
        /// 新建教材
        /// </summary>
        /// <param name="create"></param>
        /// <returns></returns>
        Task<int> CreateAsync(CreateTextbookDto create);

        /// <summary>
        /// 更新教材信息
        /// </summary>
        /// <param name="id"></param>
        /// <param name="update"></param>
        /// <returns></returns>
        Task UpdateAsync(int id, UpdateTextbookDto update);

        /// <summary>
        /// 激活教材
        /// </summary>
        /// <param name="id"></param>
        /// <param name="isActive"></param>
        /// <returns></returns>
        Task<bool> ActiveAsync(int id, bool isActive = false);

        /// <summary>
        /// 删除教材
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task DeleteAsync(int id);
        /// <summary>
        /// 同步教材
        /// </summary>
        /// <returns></returns>
        Task DataSyncAsync();
    }
}