fix
This commit is contained in:
parent
99aa07348f
commit
c735f0497c
@ -16,7 +16,22 @@ def start_webhook_chain(body: Any, form: Any, args: Any):
|
|||||||
WebhookChain().message(body=body, form=form, args=args)
|
WebhookChain().message(body=body, form=form, args=args)
|
||||||
|
|
||||||
|
|
||||||
@router.route(path="/", methods=['GET', 'POST'], name="Webhook消息响应")
|
@router.post("/", summary="Webhook消息响应", response_model=schemas.Response)
|
||||||
|
async def webhook_message(background_tasks: BackgroundTasks,
|
||||||
|
token: str, request: Request) -> Any:
|
||||||
|
"""
|
||||||
|
Webhook响应
|
||||||
|
"""
|
||||||
|
if token != settings.API_TOKEN:
|
||||||
|
return schemas.Response(success=False, message="token认证不通过")
|
||||||
|
body = await request.body()
|
||||||
|
form = await request.form()
|
||||||
|
args = request.query_params
|
||||||
|
background_tasks.add_task(start_webhook_chain, body, form, args)
|
||||||
|
return schemas.Response(success=True)
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/", summary="Webhook消息响应", response_model=schemas.Response)
|
||||||
async def webhook_message(background_tasks: BackgroundTasks,
|
async def webhook_message(background_tasks: BackgroundTasks,
|
||||||
token: str, request: Request) -> Any:
|
token: str, request: Request) -> Any:
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user