mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-20 20:39:55 +00:00
docs(backend): 重构后端README文档,完善项目文档与开发指南
- 全面更新README,添加项目特性、架构设计与技术栈介绍 - 详细补充项目结构说明及模块设计规范 - 增加快速开始步骤,包括环境配置、数据库初始化和服务启动 - 补充主要API模块路径和认证授权使用示例 - 添加开发指南、数据库迁移与测试方法 - 集成监控、日志级别说明及性能监控内容 - 完善Docker、传统部署及Nginx配置示例 - 添加贡献指南和代码规范说明 - 新增MCP模块概述及智能对话API接口文档 - 清理和移除module_ai中旧的mcp_server相关实现代码 - 在api/v1初始化文件中注册AI模块路由 - 修改resource模块,增强资源路径安全检查和文件类型检测逻辑 - 增强资源搜索和上传服务的健壮性及安全性
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import asyncio
|
||||
from typing import Any, AsyncGenerator
|
||||
from fastapi_mcp import FastApiMCP
|
||||
from fastapi import FastAPI
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.concurrency import asynccontextmanager
|
||||
@@ -10,7 +10,6 @@ from fastapi.openapi.docs import (
|
||||
get_swagger_ui_html,
|
||||
get_swagger_ui_oauth2_redirect_html
|
||||
)
|
||||
from sqlalchemy import text
|
||||
|
||||
from app.config.setting import settings
|
||||
from app.core.ap_scheduler import SchedulerUtil
|
||||
@@ -103,6 +102,20 @@ def register_routers(app: FastAPI) -> None:
|
||||
"""
|
||||
app.include_router(router=router)
|
||||
|
||||
def register_fastapi_mcp(app: FastAPI) -> None:
|
||||
"""
|
||||
注册FastAPI-MCP路由
|
||||
"""
|
||||
mcp = FastApiMCP(
|
||||
app,
|
||||
name="FastAPI Vue3 Admin MCP",
|
||||
description="MCP server for the FastAPI Vue3 Admin system",
|
||||
describe_full_response_schema=True,
|
||||
describe_all_responses=True,
|
||||
)
|
||||
mcp.mount()
|
||||
# mcp.mount_http()
|
||||
|
||||
def register_files(app: FastAPI) -> None:
|
||||
"""
|
||||
注册文件相关配置
|
||||
@@ -140,4 +153,4 @@ def reset_api_docs(app: FastAPI) -> None:
|
||||
title=app.title + " - ReDoc",
|
||||
redoc_js_url=settings.REDOC_JS_URL,
|
||||
redoc_favicon_url=settings.FAVICON_URL,
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user