package ink.wgink.module.file.service;

import ink.wgink.module.file.enums.UploadTypeEnum;
import ink.wgink.pojo.pos.FilePO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * @ClassName: IMinIOService
 * @Description: minIO
 * @Author: wanggeng
 * @Date: 2021/10/17 10:15 上午
 * @Version: 1.0
 */
public interface IMinIoFileService {

    /**
     * 物理删除文件
     *
     * @param filePOs 要删除的文件列表
     */
    void deleteFile(List<FilePO> filePOs);

    /**
     * 上传文件
     *
     * @param token
     * @param uploadFile
     * @param uploadTypeEnum
     * @param params
     */
    void uploadFile(String token, MultipartFile uploadFile, UploadTypeEnum uploadTypeEnum, Map<String, Object> params);

    /**
     * 文件上传
     *
     * @param userId         用户ID
     * @param uploadFile
     * @param uploadTypeEnum
     * @param params
     */
    void uploadFileByUserId(String userId, MultipartFile uploadFile, UploadTypeEnum uploadTypeEnum, Map<String, Object> params);

    /**
     * 下载文件
     *
     * @param request
     * @param response
     * @param filePO
     * @param isOpen
     * @param canRange
     */
    boolean downLoadFile(HttpServletRequest request, HttpServletResponse response, FilePO filePO, boolean isOpen, boolean canRange);

}
