package com.xhkjedu.smarking.utils;

import com.xhkjedu.smarking.listener.MessageSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

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

/**
 * @author ywx
 * @classname ConvertUtil
 * @description 文件转换工具类
 * @date 2021/10/27 9:32
 **/
@Component
public class ConvertUtil {
    @Autowired
    private MessageSender messageSender;

    /**
     * 学生答案图片合并mq
     *
     * @param [mpsqid, userAnswers,]
     * @return void
     * @author ywx
     * @date 2022/5/9 14:57
     */
    public void imgMerge(Integer mpsqid, List<String> userAnswers) {
        messageSender.imgMerge(mpsqid, userAnswers);
    }

    /** 考试附件试卷图片转pdf
     * @Description
     * @Param [imgs, epid]
     * @Return void
     * @Author wn
     * @Date 2022/11/1 10:51
     **/
    public void imgToPdf(List<String> imgs,Integer mpid,Integer filetype){
        messageSender.ImgToPdf(imgs,mpid,filetype);
    }

    /**
     * @Description 考试报告html转pdf
     * @Param [map]
     * @Author ywx
     * @Date 2023/2/14 11:24
     * @return void
     **/
    public void htmlToPdf(Map map) {
        messageSender.htmlToPdf(map);
    }
}
