clx_IT a03f53b54f 删除 'Return.md' | 1 gadu atpakaļ | |
---|---|---|
.idea | 1 gadu atpakaļ | |
app | 1 gadu atpakaļ | |
config | 1 gadu atpakaļ | |
models | 1 gadu atpakaļ | |
routers | 1 gadu atpakaļ | |
test | 1 gadu atpakaļ | |
utils | 1 gadu atpakaļ | |
Dockerfile | 1 gadu atpakaļ | |
README.md | 1 gadu atpakaļ | |
docker-compose.yml | 1 gadu atpakaļ | |
requirements.txt | 1 gadu atpakaļ | |
test_main.http | 1 gadu atpakaļ |
该项目由三个接口组成
URI设计 :/file
访问地址:localhost:8000/file
传参:文件【file】 传入一个二进制文件流
返回值:状态码+URI
样例:
-- 操作成功
{
"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是图片名称信息
返回值:
样例:
-- 操作成功
{
"data":[]
"msg": "",
"status": 200
}
-- 操作失败
{
"data":[]
"msg": "Not Found",
"status": 404
}
A simple example of using Fast API in Python.
git clone git@gitee.com:cao-lixu/fastap_minio.git
pip install -r requirements.txt
docker run -p 9000:9000 minio/minio:RELEASE.2021-06-17T00-10-46Z server /data
uvicorn app.main:app --reload
pytest test/test.py
docker-compose up -d --build
docker-compose exec app pytest test/test.py
http://127.0.0.1:8000/docs
docker-compose exec --username=fastapi