- Added DownloadTokenManager for creating and verifying JWT download tokens. - Introduced new download routes for creating download tokens and downloading files using tokens. - Restructured file upload routes into a dedicated sub-router. - Updated file upload session management with improved error handling and response structures. - Created a new MCP (Microservice Communication Protocol) router with basic request and response models. - Added base models for MCP requests and responses, including method enumeration.
19 lines
376 B
Python
19 lines
376 B
Python
from fastapi import APIRouter
|
|
|
|
from models import MCPRequestBase, MCPResponseBase, MCPMethod
|
|
|
|
# MCP 路由
|
|
MCP_router = APIRouter(
|
|
prefix='/mcp',
|
|
tags=["mcp"],
|
|
)
|
|
|
|
@MCP_router.get(
|
|
"/",
|
|
)
|
|
async def mcp_root(
|
|
param: MCPRequestBase
|
|
):
|
|
match param.method:
|
|
case MCPMethod.PING:
|
|
return MCPResponseBase(result="pong", **param.model_dump()) |