dify插件初步构建
This commit is contained in:
28
difyPlugin/app/api/test/HelloWordAPI.py
Normal file
28
difyPlugin/app/api/test/HelloWordAPI.py
Normal 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")
|
||||
Reference in New Issue
Block a user