feat: 更新飞书通知
This commit is contained in:
12
app/main.py
12
app/main.py
@@ -1,4 +1,5 @@
|
|||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
|
import requests
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
||||||
@@ -6,3 +7,14 @@ app = FastAPI()
|
|||||||
@app.get("/")
|
@app.get("/")
|
||||||
async def root():
|
async def root():
|
||||||
return {"message": "Hello World"}
|
return {"message": "Hello World"}
|
||||||
|
|
||||||
|
# 飞书通知
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/feishu")
|
||||||
|
async def root():
|
||||||
|
headers = {'Content-Type': 'application/json'}
|
||||||
|
# https://open.feishu.cn/open-apis/bot/v2/hook/5fb1b44c-3446-42ef-9b3a-dd37731567dd
|
||||||
|
r = requests.post('https://httpbin.org/post',
|
||||||
|
data={'msg_type': 'text', "content": {"text": "request example"}}, headers=headers)
|
||||||
|
return {"message": "触发飞书webhook"}
|
||||||
|
|||||||
Reference in New Issue
Block a user