using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Abp.Application.Services;
using Abp.Application.Services.Dto;
using Microsoft.AspNetCore.Http;
using YGNT.QuestionLibrary.Core.BaseData.Enum;
using YGNT.QuestionLibrary.Questions.Dto;

namespace YGNT.QuestionLibrary.Questions
{
    /// <summary>
    /// 试题管理
    /// </summary>
    public interface IQuestionAppService : IApplicationService
    {
        /// <summary>
        /// 查询试题列表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        Task<PagedResultDto<QuestionDto>> GetListAsync(SearchQuestionInputDto search);

        /// <summary>
        /// 获取试题详情(结构)
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<QuestionInfoDto> GetInfoAsync(long id);

        /// <summary>
        /// 获取导入模板
        /// </summary>
        /// <param name="disciplineId"></param>
        /// <returns></returns>
        Task<object> GetQuestionTemplateAsync(int disciplineId);

        /// <summary>
        /// 获取试题的doc文本
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<object> GetQuestionDocAsync(long id);

        /// <summary>
        /// 修改试题
        /// </summary>
        /// <param name="id"></param>
        /// <param name="update"></param>
        /// <returns></returns>
        Task UpdateAsync(long id, UpdateQuestionDto update);

        /// <summary>
        /// 修改试题原始数据
        /// </summary>
        /// <param name="questionOriginId"></param>
        /// <param name="update"></param>
        /// <returns></returns>
        Task UpdateOriginAsync(long questionOriginId, UpdateQuestionOriginDto update);

        /// <summary>
        /// 试题解析
        /// </summary>
        /// <param name="resolveDto"></param>
        /// <returns></returns>
        Task ResolveAsync(QuestionResolveDto resolveDto);

        /// <summary>
        /// 替换试题
        /// </summary>
        /// <param name="replace"></param>
        /// <returns></returns>
        Task ReplaceAsync(ReplaceQuestionDto replace);

        /// <summary>
        /// 是否激活
        /// </summary>
        /// <param name="id"></param>
        /// <param name="isActive"></param>
        /// <returns></returns>
        Task ActiveAsync(long id, bool isActive);

        /// <summary>
        /// 是否激活
        /// </summary>
        /// <param name="idList"></param>
        /// <param name="isActive"></param>
        /// <returns></returns>
        Task ActiveListAsync(List<long> idList, bool isActive);

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

        /// <summary>
        /// 删除试题
        /// </summary>
        /// <param name="idList"></param>
        /// <returns></returns>
        Task DeleteListAsync(List<long> idList);

        //Task Test(long id);

        /// <summary>
        /// 获取试题的解析和答案
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<QuestionAnalysisDto> GetAnalysisAsync(long id);
        /// <summary>
        /// 获取试题列表，根据试题ID（外接口）
        /// </summary>
        /// <param name="select"></param>
        /// <returns></returns>
        Task<List<QuestionSelectDto>> PostListAsync(SelectQuestionInputDto select);

        /// <summary>
        /// 随机练习
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        Task<List<long>> GetListRandAsync(SearchQuestionRandInputDto search);

    }
}