com.github.javaclub.ossclient.OssClient Maven / Gradle / Ivy
package com.github.javaclub.ossclient;
import java.util.Map;
import org.springframework.web.multipart.MultipartFile;
public interface OssClient {
/**
* 上传文件到OSS, 返回访问url链接
*
* @param file Web上传file对象
* @param relativePathInBucket 在bucket中的相对路径path
* @param params 附带参数
* @return
*/
String upload(MultipartFile file, String relativePathInBucket, Map params);
/**
* 上传文件到OSS, 返回访问url链接
*
* @param bytes 数据流字节
* @param relativeFilenameInBucket 完整文件名(如: files/products/20230901/dfeff43eer54fe3.jpg)
* @param params 附带参数
* @return
*/
String upload(byte[] bytes, String relativeFilenameInBucket, Map params);
}