Commit 9afd9cc4 authored by 郭人方's avatar 郭人方

docs:修改第三方对象存储服务说明,添加桶参数。

parent ace2760f
......@@ -30,7 +30,7 @@
### 2.3 服务调用
`StorageService`个上传接口,分别是:
`StorageService`个上传接口,分别是:
```java
/**
......@@ -59,8 +59,66 @@
* @throws Exception
*/
String upload(File file, String fileName) throws Exception;
// 以下3个是添加桶参数上传接口
/**
* 上传文件到云存储, 返回图片HTTP地址
*
* @param data 字节数据
* @param fileName 云存储文件路径
* @param bucket 桶
* @return 图片HTTP地址
* @throws Exception
*/
String upload(byte[] data, String fileName, String bucket) throws Exception;
/**
* 上传文件到云存储, 返回图片HTTP地址
*
* @param inputStream 字节流
* @param fileName 云存储文件路径
* @param bucket 桶
* @return 图片HTTP地址
* @throws Exception
*/
String upload(InputStream inputStream, String fileName, String bucket) throws Exception;
/**
* 上传文件到云存储, 返回图片HTTP地址
*
* @param file 文件
* @param fileName 云存储文件路径
* @param bucket 桶
* @return 图片HTTP地址
* @throws Exception
*/
String upload(File file, String fileName, String bucket) throws Exception;
```
`StorageService`有两个下载接口,分别是:
```java
/**
* 文件下载读取二进制流数据
*
* @param fileName 文件URL
* @return
* @throws Exception
*/
byte[] download(String fileName) throws Exception;
/**
* 文件下载读取二进制流数据,添加桶参数
*
* @param fileName 文件URL
* @param bucket 桶
* @return
* @throws Exception
*/
byte[] download(String fileName,String bucket) throws Exception;
```
样例工程中使用的是byte[],以下是样例代码:
```java
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment