package com.vctgo.file.service;

import com.vctgo.system.api.domain.FileInfo;
import io.swagger.models.auth.In;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

public interface IDistributedFileSystemService {

    /**
     * 文件上传接口
     *
     * @param file 上传的文件
     * @return 访问地址
     * @throws Exception
     */
    String uploadFile(MultipartFile file) throws Exception;

    /**
     * 删除文件
     */
    void deleteMinioFile(List<FileInfo> sysFileIdListTmp);

    /**
     * 批量下载
     *
     * @param fileInfoList
     * @param zipName
     * @param res
     * @param req
     */
    void batchDownload(List<FileInfo> fileInfoList, String zipName, HttpServletResponse res, HttpServletRequest req, ConcurrentHashMap<String, Integer> concurrentHashMap);

    /**
     * 下载单个文件
     *
     * @param fileInfo
     * @param filename
     * @param res
     * @param req
     */
    void download(FileInfo fileInfo, String filename, String fileExtension, HttpServletResponse res, HttpServletRequest req);

    /**
     * 批量下载文件
     *
     * @param fileInfoList
     * @param zipName
     * @param res
     * @param req
     */
    void batchDownload(List<FileInfo> fileInfoList, String zipName, HttpServletResponse res, HttpServletRequest req);
}
