package com.qmth.teachcloud.common.service;

import com.qmth.teachcloud.common.bean.vo.FilePathVo;
import com.qmth.teachcloud.common.entity.BasicAttachment;
import com.qmth.teachcloud.common.enums.UploadFileEnum;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.InputStream;

public interface FileUploadService {

    FilePathVo uploadFile(File sourceFile, UploadFileEnum uploadFileEnum, String fileName);

    FilePathVo uploadFile(MultipartFile file, UploadFileEnum uploadFileEnum, String fileName, String md5);
    FilePathVo uploadFile(InputStream inputStream, UploadFileEnum uploadFileEnum, String fileName, String md5);

    File downloadFile(String path, String pathName) throws Exception;

    File downloadFile(String type, UploadFileEnum uploadFileEnum, String path, String pathName) throws Exception;

    File downloadFile(Long attachmentId, String pathName) throws Exception;

    File downloadFile(BasicAttachment attachment, String pathName) throws Exception;

    String filePreview(String path);

    String filePreview(Long attachmentId);

    String filePreviewPrefix(String path);
}
