package com.qmth.jkserver.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.jkserver.enums.ExamType;
import com.qmth.jkserver.model.Attachment;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

public interface AttachmentService extends IService<Attachment> {

    public Attachment findByIdService(Long id);

    public Attachment saveService(Attachment attachment);

    public List<Attachment> save(List<Attachment> attachments);

    public Attachment saveFolder(Attachment attachment);

    public void deleteByIdService(Long id);

    //考务文件转存
    public Attachment copyKwWorkFile2Storage(Long fileId, String examCode, ExamType examType) throws Exception;

    public List<String> findDistinctExtByExamCode(String examCode);

    public void copyFile(File src, File target) throws FileNotFoundException, IOException;

    public void copyFileToDirectory(File src, File directory) throws IOException;

}
