docs: add comprehensive API documentation with Swagger
This commit is contained in:
+54
-1
@@ -1,4 +1,5 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from app.api.router import api_router
|
||||
from app.core.config import get_settings
|
||||
@@ -6,8 +7,60 @@ from app.core.config import get_settings
|
||||
|
||||
def create_app() -> FastAPI:
|
||||
settings = get_settings()
|
||||
app = FastAPI(title=settings.app_name)
|
||||
|
||||
app = FastAPI(
|
||||
title="小虾 SaaS API",
|
||||
description="""
|
||||
小虾 SaaS 自动化剪辑系统 API
|
||||
|
||||
## 功能模块
|
||||
|
||||
### 📁 资源库管理
|
||||
- **Projects**: 项目管理
|
||||
- **Asset Libraries**: 资产库管理
|
||||
- **Assets**: 素材资产管理
|
||||
|
||||
### 📤 素材导入
|
||||
- **Upload**: 文件上传(支持 MinIO 对象存储)
|
||||
- **Ingest Jobs**: 素材导入任务管理
|
||||
|
||||
### 🎬 自动化剪辑
|
||||
- 智能场景分割
|
||||
- 自动转场
|
||||
- 字幕生成
|
||||
|
||||
## 技术栈
|
||||
- FastAPI + Python 3.12
|
||||
- PostgreSQL 数据库
|
||||
- Redis 队列
|
||||
- Celery 异步任务
|
||||
- MinIO 对象存储
|
||||
""",
|
||||
version="0.1.0",
|
||||
docs_url="/docs",
|
||||
redoc_url="/redoc",
|
||||
openapi_url="/openapi.json",
|
||||
contact={
|
||||
"name": "小虾团队",
|
||||
"email": "dev@xiaoxiajianji.com",
|
||||
},
|
||||
license_info={
|
||||
"name": "Proprietary",
|
||||
},
|
||||
)
|
||||
|
||||
# CORS middleware
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"], # TODO: Configure for production
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
# Include API routes
|
||||
app.include_router(api_router, prefix=settings.api_prefix)
|
||||
|
||||
return app
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user