package com.tofly.feesapi.file.fileconfiguration;

import com.tofly.feesapi.file.entity.dto.FileUploadBase64Dto;
import com.tofly.feesapi.file.entity.dto.FileUploadResponse;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.List;

public interface FileStorageService {

    /**
     * 上传文件
     */
    FileUploadResponse upload(MultipartFile file, String path);

    FileUploadResponse uploadFileBase64(FileUploadBase64Dto file, String Path);

    /**
     * 下载文件
     */
    ResponseEntity<?> download(String fileName, HttpServletRequest request, HttpServletResponse response);

    byte[] getByteDataforFile(String fileName);

    InputStream getByteDataforFileInputStream(String fileName);

    Boolean  retrieveFile(String remotePath, OutputStream outputStream);

    String uploadFile(String Path, String fileName, String contentType, InputStream inputStream)
            throws IOException;

    void removeFile(String PathfileName) throws IOException;

}
