package com.qmth.paper.library.business.service;

import com.qmth.paper.library.business.bean.vo.PathSequenceVo;
import com.qmth.paper.library.business.entity.PaperScanTask;
import com.qmth.paper.library.common.entity.BasicAttachment;
import com.qmth.paper.library.common.entity.ExamStudent;
import com.qmth.paper.library.common.entity.SysOrg;
import com.qmth.paper.library.common.enums.TaskTypeEnum;
import com.qmth.paper.library.common.enums.UploadFileEnum;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Map;

/**
 * 公共服务service
 */
public interface PaperLibraryCommonService {

    String getScanTaskCode(Long schoolId);

    /**
     * 保存附件公用
     */
    BasicAttachment saveAttachmentCommon(MultipartFile file, String md5, UploadFileEnum type, Long objId);

    /**
     * 保存附件
     */
    BasicAttachment saveAttachment(MultipartFile file, String md5, UploadFileEnum type);

    /**
     * 机构禁用
     */
    boolean enable(SysOrg org);

    /**
     * 机构删除
     */
    boolean sysOrgRemove(String ids);

    /**
     * 保存任务
     */
    Map<String, Object> saveTask(MultipartFile file, TaskTypeEnum taskTypeEnum);
    Map<String, Object> saveTask(MultipartFile file, Long examId, TaskTypeEnum taskTypeEnum);

    PathSequenceVo saveLibraryFile(PaperScanTask paperScanTask, ExamStudent examStudent, UploadFileEnum uploadFileEnum, int studentSequence, MultipartFile... files);

    PathSequenceVo saveLibraryOtherFile(PaperScanTask paperScanTask, UploadFileEnum uploadFileEnum, String fileNamePrefix, String classRoomName, MultipartFile... files);

    File downloadFile(String rootPath, String path, String uploadType, String type) throws FileNotFoundException;
}
