Merge branch 'refactor/backend-architecture' into development
This commit is contained in:
25
api/app/core/openapi.py
Normal file
25
api/app/core/openapi.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""
|
||||
OpenAPI 全局增强:只做 title/version/description 等元数据,不替代 router 上的正常声明。
|
||||
"""
|
||||
|
||||
from fastapi import FastAPI
|
||||
from fastapi.openapi.utils import get_openapi
|
||||
|
||||
|
||||
def custom_openapi(app: FastAPI) -> dict:
|
||||
if app.openapi_schema:
|
||||
return app.openapi_schema
|
||||
|
||||
openapi_schema = get_openapi(
|
||||
title="Life Echo API",
|
||||
version="1.0.0",
|
||||
summary="岁月时书 — 口述回忆录生产平台",
|
||||
description=(
|
||||
"为老年用户提供 AI 驱动的回忆录创作服务:\n"
|
||||
"语音对话采集 → 素材沉淀 → 章节生成 → PDF 导出。"
|
||||
),
|
||||
routes=app.routes,
|
||||
)
|
||||
|
||||
app.openapi_schema = openapi_schema
|
||||
return app.openapi_schema
|
||||
Reference in New Issue
Block a user