94 lines
2.0 KiB
Java
94 lines
2.0 KiB
Java
package com.heyu.api.oss;
|
||
|
||
import org.springframework.scheduling.annotation.Async;
|
||
import org.springframework.web.multipart.MultipartFile;
|
||
|
||
import java.io.File;
|
||
import java.io.InputStream;
|
||
|
||
/**
|
||
* 类OssFileUploadService.java的实现描述:
|
||
*
|
||
* @author richen
|
||
* @date 2015年12月1日 下午6:11:20
|
||
* @描述 oss上传文件
|
||
*/
|
||
public interface OssFileUploadService {
|
||
|
||
/**
|
||
* 上传图片
|
||
*
|
||
* @param file 图片文件
|
||
* @return
|
||
*/
|
||
OssUploadResult uploadToOss(MultipartFile file);
|
||
|
||
|
||
OssUploadResult uploadImageToOss(MultipartFile imageFile);
|
||
|
||
/**
|
||
* 上传图片
|
||
*
|
||
* @param inputStream 文件流
|
||
* @param fileName 文件名
|
||
* @param fileSize 文件大小
|
||
* @return
|
||
*/
|
||
OssUploadResult uploadImageToOss(InputStream inputStream, String fileName, int fileSize);
|
||
|
||
|
||
/**
|
||
* 异步上传图片
|
||
*
|
||
* @param inputStream 文件流
|
||
* @param fileName 文件名
|
||
* @param fileSize 文件大小
|
||
* @return
|
||
*/
|
||
@Async
|
||
OssUploadResult uploadImageToOssAsync(InputStream inputStream, String fileName, int fileSize);
|
||
|
||
|
||
/**
|
||
* 上传文件
|
||
*
|
||
* @param file 文件
|
||
* @param path 路径
|
||
* @throws Exception
|
||
*/
|
||
void uploadUploadFile(File file, String path) throws Exception;
|
||
|
||
|
||
/**
|
||
* 上传PDF文件
|
||
*
|
||
* @param file 文件
|
||
* @param remotePath 外网路径
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
String uploadPdfFile(File file, String remotePath) throws Exception;
|
||
|
||
|
||
/**
|
||
* 上传PDF文件(文件流)
|
||
*
|
||
* @param inputStream 文件流
|
||
* @param fileName 文件名
|
||
* @param remotePath 上传地址
|
||
* @return 文件URL
|
||
* @throws Exception
|
||
*/
|
||
String uploadPdfFile(InputStream inputStream, String fileName, String remotePath) throws Exception;
|
||
|
||
/**
|
||
* 上传base64 的文件到oss
|
||
*
|
||
* @param base64
|
||
* @return
|
||
*/
|
||
public String uploadFileContentByBase64(String base64, String suffix);
|
||
|
||
|
||
}
|