package com.qmth.distributed.print.business.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.teachcloud.common.bean.marking.CardJpgResult;
import com.qmth.distributed.print.business.bean.params.ExamCardParams;
import com.qmth.distributed.print.business.bean.params.GenericExamCardParams;
import com.qmth.distributed.print.business.entity.ExamCard;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 题卡 服务类
 * </p>
 *
 * @author xf
 * @since 2021-03-23
 */
public interface ExamCardService extends IService<ExamCard> {

    Map<String, String> saveExamCard(ExamCardParams examCardParams) throws Exception;

    List<ExamCard> listSelectCard(String courseCode, Long examId, String paperNumber);

    IPage<ExamCard> listPage(Long semesterId, Long examId, String courseCode, String paperNumber, String cardType, String title, String createMethod, Boolean enable, Long createStartTime, Long createEndTime, Integer pageNumber, Integer pageSize);

    Map<String, String> saveGeneric(GenericExamCardParams params) throws Exception;

    Boolean deleteGeneric(Long id);

    /**
     * 题卡复制
     *
     * @param id         被复制的题卡id
     * @param courseCode 复制后的题卡所绑定的课程编号
     * @return 复制后的题卡id
     */
    Long copyCard(Long id, String courseCode);

    void convertImage(Long id);

    void downloadCard(HttpServletResponse response, String id);

    List<CardJpgResult> listCardImage(Long examId, String paperNumber, String paperType);

    ExamCard createJpgImage(ExamCard examCard);

    void downloadCardJson(HttpServletResponse response, String id);
}
