using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Abp.Domain.Services;
using YGNT.QuestionLibrary.Core.BaseData;
using YGNT.QuestionLibrary.Core.Models;
using YGNT.QuestionLibrary.Core.Questions.Models;

namespace YGNT.QuestionLibrary.Core.Questions.Domain
{
    public interface IQuestionManager : IDomainService
    {
        /// <summary>
        /// 新建试题
        /// </summary>
        /// <param name="shortName">试题简称</param>
        /// <param name="disciplineId">学科Id</param>
        /// <param name="disciplineQuestionTypeId">学科细分题型Id</param>
        /// <param name="difficulty">难度</param>
        /// <param name="questionOriginId">试题真实id</param>
        /// <param name="chapterId">章节id</param>
        /// <param name="knowledgePointList">试题包含知识点</param>
        /// <param name="ariseTime">出题年份</param>
        /// <param name="checkPoints">章节</param>
        /// <param name="isActive">是否激活(默认不激活)</param>
        /// <returns></returns>
        Task<Question> CreateAsync(string shortName,
            int disciplineId,
            int disciplineQuestionTypeId,
            Difficulty difficulty,
            long questionOriginId,
            long? chapterId = null,
            List<long> knowledgePointList = null,
            DateTime? ariseTime = null,
            string checkPoints = null,
            bool isActive = false);

        /// <summary>
        /// 编辑试题
        /// </summary>
        /// <param name="question">试题</param>
        /// <param name="questionHtml">试题完整内容(题干+选项)</param>
        /// <param name="stemHtml">题干html</param>
        /// <param name="answerHtml">答案html</param>
        /// <param name="analysisHtml">解析html</param>
        /// <param name="options">试题选项</param>
        /// <returns></returns>
        Task UpdateQuestionAsync(Question question,
            string questionHtml,
            string stemHtml,
            string answerHtml,
            string analysisHtml,
            List<UpdateOptionDto> options);

        /// <summary>
        /// 修改试题原始数据
        /// </summary>
        /// <param name="questionOrigin"></param>
        /// <param name="questionHtml">试题完整内容(题干+选项)</param>
        /// <param name="stemHtml">题干html</param>
        /// <param name="answerHtml">答案html</param>
        /// <param name="analysisHtml">解析html</param>
        /// <param name="options">试题选项</param>
        /// <returns></returns>
        Task UpdateQuestionOriginAsync(QuestionOrigin questionOrigin,
           string questionHtml,
           string stemHtml,
           string answerHtml,
           string analysisHtml,
           List<UpdateOptionDto> options);

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