package com.njzscloud.common.oss.service;

import com.njzscloud.common.core.tuple.Tuple2;
import org.springframework.web.multipart.MultipartFile;

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

public interface OSSService {
    /**
     * 开始分片上传
     */
    Tuple2<String, List<String>> startMltUpload(String objectName, String contentType, int partNum);

    /**
     * 结束分片上传
     */
    void endMltUpload(String objectName, String uploadId, int partNum);

    /**
     * 获取上传链接
     */
    Map<String, String> obtainPresignedUrl(String filename);

    /**
     * 获取文件
     */
    void obtainFile(String bucketName, String objectName, HttpServletResponse response);

    String uploadFile(MultipartFile file);
}
