using System;
using System.Threading.Tasks;
using Abp.Domain.Services;
using QuestionSwapDoc.SwapQuestionModel;
using YGNT.QuestionLibrary.Core.Models;
using YGNT.QuestionLibrary.Core.Questions;
using YGNT.QuestionLibrary.Core.Tasks.Enum;

namespace YGNT.QuestionLibrary.Core.Tasks.Domain
{
    public interface IQuestionResolveManager : IDomainService
    {
        /// <summary>
        /// 创建试题解析任务
        /// </summary>
        /// <param name="name"></param>
        /// <param name="fileId"></param>
        /// <param name="disciplineId"></param>
        /// <param name="targetId"></param>
        /// <param name="targetType"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<QuestionResolveTask> CreateTaskAsync(string name,
            Guid fileId,
            int disciplineId,
            long targetId,
            ImportTargetType targetType,
            long? userId = null);

        /// <summary>
        /// 检查是否已存在解析
        /// </summary>
        /// <param name="fileId"></param>
        /// <returns></returns>
        Task<TaskState?> CheckStateAsync(Guid fileId);


        /// <summary>
        /// 解析
        /// </summary>
        /// <param name="resolveTask"></param>
        /// <returns></returns>
        void Resolve(QuestionResolveTask resolveTask);

        /// <summary>
        /// 保存试题解析
        /// </summary>
        /// <param name="questionOrigin"></param>
        /// <param name="question"></param>
        void SaveResolve(QuestionOrigin questionOrigin, QueItem question);
    }
}