package com.qmth.jkserver.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.jkserver.model.ExamTask;
import com.qmth.jkserver.model.User;
import org.springframework.scheduling.annotation.Async;

import java.util.Map;

/**
 * @Description: 考试任务
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/5/11
 */
public interface ExamTaskService extends IService<ExamTask> {

    /**
     * 保存任务
     *
     * @param examCode
     * @param user
     * @param resetSync
     * @return
     */
    public Map<String, Object> saveExamTask(String examCode, User user, boolean resetSync);

    /**
     * 更新任务
     *
     * @param examTask
     * @param user
     * @return
     */
    public Map<String, Object> updateExamTask(ExamTask examTask, User user);

    /**
     * 完成任务
     *
     * @param examTask
     * @param user
     * @return
     */
    public Map<String, Object> finishExamTask(ExamTask examTask, User user);

    /**
     * 更新任务状态
     */
    @Async
    public void updateStatus() throws Exception;
}
