package org.jeecg.common.util.store;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;

public interface FileStoreUtil extends InitializingBean {

    default String upload(MultipartFile file, String bizPath) throws Exception {
        return upload(file, bizPath, null);
    }

    String upload(MultipartFile file, String bizPath, String bucket) throws Exception;

    String upload(InputStream inputStream, String bizPath) throws Exception;

    default String getObjectUrl(String objectName) throws Exception {
        return null;
    }

    /**
     * 获取文件地址
     *
     * @param bizPath
     * @return
     * @throws Exception
     */
    String getFileUrl(String bizPath) throws Exception;

    /**
     * 获取文件流
     *
     * @param objectName
     * @return
     */
    InputStream getFile(String objectName);
}
