|
@@ -1,3 +1,106 @@
|
|
|
+#### 项目目标
|
|
|
+
|
|
|
+- 使用fastapi + minio实现图床功能, 上传+下载 + 删除
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+该项目由三个接口组成
|
|
|
+
|
|
|
+- 上传接口
|
|
|
+- 下载接口
|
|
|
+- 删除接口
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+###### 上传接口:
|
|
|
+
|
|
|
+- URI设计 :/file
|
|
|
+
|
|
|
+- 访问地址:localhost:8000/file
|
|
|
+
|
|
|
+- 传参:文件【file】
|
|
|
+ 传入一个二进制文件流
|
|
|
+
|
|
|
+- 返回值:状态码+URI
|
|
|
+
|
|
|
+ 样例:
|
|
|
+
|
|
|
+ ```python
|
|
|
+ -- 操作成功
|
|
|
+ {
|
|
|
+ "status": 200,
|
|
|
+ "data": "1685503168185763.png",
|
|
|
+ "msg":""
|
|
|
+ }
|
|
|
+
|
|
|
+ -- 操作失败
|
|
|
+ {
|
|
|
+ "status": 400,
|
|
|
+ "data":""
|
|
|
+ "msg": "上传失败"
|
|
|
+ }
|
|
|
+ ```
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+###### 下载接口:
|
|
|
+
|
|
|
+- RUI设计:/file/{uid}
|
|
|
+
|
|
|
+- 访问地址:localhost:8000/file
|
|
|
+
|
|
|
+- 传参:uid:uid是图片名称信息
|
|
|
+
|
|
|
+- 返回值:
|
|
|
+
|
|
|
+ 图片预览或是下载【或uri】
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+###### 删除接口:
|
|
|
+
|
|
|
+- RUI设计:/file/{uid}
|
|
|
+
|
|
|
+- 访问地址:localhost:8000/file/{uid}
|
|
|
+
|
|
|
+- 传参:uid:uid是图片名称信息
|
|
|
+
|
|
|
+- 返回值:
|
|
|
+
|
|
|
+ 样例:
|
|
|
+
|
|
|
+ ```python
|
|
|
+ -- 操作成功
|
|
|
+ {
|
|
|
+ "data":[]
|
|
|
+ "msg": "",
|
|
|
+ "status": 200
|
|
|
+ }
|
|
|
+
|
|
|
+ -- 操作失败
|
|
|
+ {
|
|
|
+ "data":[]
|
|
|
+ "msg": "Not Found",
|
|
|
+ "status": 404
|
|
|
+ }
|
|
|
+ ```
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
A simple example of using Fast API in Python.
|
|
|
|
|
|
## Preconditions:
|