package ink.wgink.module.examine.dao.question;

import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException;
import ink.wgink.interfaces.init.IInitBaseTable;
import ink.wgink.module.examine.pojo.dtos.question.QuestionOptionsDTO;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: IQuestionOptionsDao
 * @Description: 试题选项
 * @Author: WenG
 * @Date: 2020-09-09 21:00
 * @Version: 1.0
 **/
@Repository
public interface IQuestionOptionsDao extends IInitBaseTable {

    /**
     * 新增试题选项
     *
     * @param params
     * @throws SaveException
     */
    void save(Map<String, Object> params) throws SaveException;

    /**
     * 删除试题选项
     *
     * @param params
     * @throws RemoveException
     */
    void remove(Map<String, Object> params) throws RemoveException;

    /**
     * 删除试题选项（物理）
     *
     * @param params
     * @throws RemoveException
     */
    void delete(Map<String, Object> params) throws RemoveException;

    /**
     * 删除选项（通过试题ID）
     *
     * @param questionId
     * @throws RemoveException
     */
    void deleteByQuestionId(String questionId) throws RemoveException;

    /**
     * 修改试题选项
     *
     * @param params
     * @throws UpdateException
     */
    void update(Map<String, Object> params) throws UpdateException;

    /**
     * 试题选项详情
     *
     * @param params
     * @return
     * @throws SearchException
     */
    QuestionOptionsDTO get(Map<String, Object> params) throws SearchException;

    /**
     * 试题选项列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<QuestionOptionsDTO> list(Map<String, Object> params) throws SearchException;

    /**
     * 试题选项统计
     *
     * @param params
     * @return
     * @throws SearchException
     */
    Integer count(Map<String, Object> params) throws SearchException;

}