diff --git a/app.py b/app.py index 9a92156..7333d3b 100644 --- a/app.py +++ b/app.py @@ -8,11 +8,16 @@ import pickle import os from fastapi.responses import JSONResponse import asyncio +from pydantic import BaseModel app = FastAPI() +class Item(BaseModel): + query: Union[str, None] = None + + # 判断uid是否存在 def findUid(uiddata, phoneNum): isFind = False @@ -211,10 +216,8 @@ async def getphonenum( @app.post("/callback") # def read_root(): # return {"Hello": "World"} -def callback( - query: Union[str, None] = None, -): - print("query", query) +def callback(item: Item): + print("item", item) content = { "ans_node_name": "小微闲聊", "title": "小薇兄你好",