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

import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.module.examine.pojo.dtos.question.QuestionOptionsDTO;
import ink.wgink.module.examine.pojo.vos.question.QuestionOptionsVO;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResultList;

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

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

    /**
     * 新增试题选项
     *
     * @param questionOptionsVO
     * @return
     * @throws Exception
     */
    void save(QuestionOptionsVO questionOptionsVO) throws Exception;

    /**
     * 新增试题选项
     *
     * @param questionOptionsVO
     * @return questionOptionsId
     * @throws Exception
     */
    String saveAndReturnId(QuestionOptionsVO questionOptionsVO) throws Exception;

    /**
     * 新增
     *
     * @param questionId
     * @param options
     * @return
     * @throws Exception
     */
    void save(String questionId, List<QuestionOptionsVO> options) throws Exception;

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

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

    /**
     * 修改试题选项
     *
     * @param questionOptionsId
     * @param questionOptionsVO
     * @return
     * @throws Exception
     */
    void update(String questionOptionsId, QuestionOptionsVO questionOptionsVO) throws Exception;

    /**
     * 试题选项详情(通过ID)
     *
     * @param questionOptionsId
     * @return
     * @throws SearchException
     */
    QuestionOptionsDTO getById(String questionOptionsId) throws SearchException;

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

    /**
     * 试题选项分页列表
     *
     * @param page
     * @return
     * @throws SearchException
     */
    SuccessResultList<List<QuestionOptionsDTO>> listPage(ListPage page) throws SearchException;

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

    /**
     * 试题选项列表（通过试题ID）
     *
     * @param questionId
     * @return
     * @throws SearchException
     */
    List<QuestionOptionsDTO> listByQuestionId(String questionId) throws SearchException;

    /**
     * 试题选项列表（通过试题ID列表）
     *
     * @param questionIds
     * @return
     * @throws SearchException
     */
    List<QuestionOptionsDTO> listByQuestionIds(List<String> questionIds) throws SearchException;
}