using System.Collections.Generic;
using System.Threading.Tasks;
using Abp.Application.Services;
using Abp.Application.Services.Dto;
using YGNT.QuestionLibrary.Core.Tasks.Domain.Dto;
using YGNT.QuestionLibrary.Papers.Dto;

namespace YGNT.QuestionLibrary.Papers
{
    /// <summary>
    /// 试卷管理
    /// </summary>
    public interface IPaperAppService : IApplicationService
    {
        /// <summary>
        /// 查询试卷列表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        Task<PagedResultDto<PaperDto>> GetListAsync(SearchPaperInputDto search);

        /// <summary>
        /// 查询试卷生成结果
        /// </summary>
        /// <param name="id"></param>
        /// <param name="pagedResultRequestDto"></param>
        /// <returns></returns>
        Task<PagedResultDto<PaperProduceResultDto>> GetPaperProduceResultAsync(
          int id, PagedResultRequestDto pagedResultRequestDto);

        /// <summary>
        /// 查询试卷最新生成结果
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<PaperProduceResultDto> GetPaperProduceResultOneAsync(int id);

        /// <summary>
        /// 获取试卷详情
        /// </summary>
        /// <param name="paperId">试卷id</param>
        /// <returns></returns>
        Task<PaperInfoDto> GetPaperInfoAsync(int paperId);

        /// <summary>
        /// 创建新试卷
        /// </summary>
        /// <param name="create"></param>
        /// <returns></returns>
        Task<int> CreateAsync(CreatePaperDto create);

        /// <summary>
        /// 自动组卷
        /// </summary>
        /// <param name="paperId"></param>
        /// <param name="autoPaperSetting"></param>
        /// <returns></returns>
        Task<PaperInfoDto> AutoPaperAsync(int paperId, AutoPaperSettingDto autoPaperSetting);

        /// <summary>
        /// 生成试卷
        /// </summary>
        /// <param name="paperId"></param>
        /// <param name="paperProduce"></param>
        /// <returns></returns>
        Task ProduceAsync(int paperId, PaperProduceDto paperProduce);

        /// <summary>
        /// 保存试卷
        /// </summary>
        /// <param name="save"></param>
        /// <returns></returns>
        Task SaveAsync(PaperSaveDto save);

        /// <summary>
        /// 删除试卷
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task DeleteAsync(int id);

        /// <summary>
        /// 删除生成结果
        /// </summary>
        /// <param name="paperProduceResultId"></param>
        /// <returns></returns>
        Task DeleteProduceResultAsync(long paperProduceResultId);
    }
}