dify插件初步构建

This commit is contained in:
2025-12-30 13:38:32 +08:00
parent 8011dec826
commit c07fe6b938
27 changed files with 820 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
"""测试相关接口"""
from fastapi import APIRouter
from app.schemas.base import ResultDomain
router = APIRouter()
@router.get(
"/world",
response_model=ResultDomain[str],
summary="Hello World",
description="测试接口连通性"
)
async def hello_word() -> ResultDomain[str]:
"""Hello World 测试接口"""
return ResultDomain.ok(message="Hello World", data="Hello World")
@router.get(
"/ping",
response_model=ResultDomain[str],
summary="Ping测试",
description="测试服务是否正常运行"
)
async def ping() -> ResultDomain[str]:
"""Ping 测试接口"""
return ResultDomain.ok(message="pong", data="pong")

View File

@@ -0,0 +1,13 @@
# API模块
from fastapi import APIRouter
from .HelloWordAPI import router as hello_router
# 创建主路由器
router = APIRouter()
# 注册所有子路由
router.include_router(hello_router, prefix="/hello", tags=["测试服务"])
__all__ = ["router"]