first commit
This commit is contained in:
parent
973c47ff25
commit
4b01ff4c75
5 changed files with 40 additions and 21 deletions
26
report.py
Normal file
26
report.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
|
||||
import requests
|
||||
import json
|
||||
from logger import logger
|
||||
|
||||
#feishu_webhook_url = "https://open.feishu.cn/open-apis/bot/v2/hook/0a627129-bfe9-4958-a1c8-9dd38ece6016"
|
||||
feishu_webhook_url = "https://open.feishu.cn/open-apis/bot/v2/hook/051679ae-0bef-4a21-9ff7-25fd76cd73ee"
|
||||
def send_feishu_notification_text(message):
|
||||
headers = {
|
||||
'Content-Type': 'application/json;charset=utf-8'
|
||||
}
|
||||
payload = {
|
||||
"msg_type": "text",
|
||||
"content": {
|
||||
"text": message
|
||||
}
|
||||
}
|
||||
|
||||
try:
|
||||
response = requests.post(feishu_webhook_url, headers=headers, data=json.dumps(payload))
|
||||
if response.status_code == 200:
|
||||
logger.info(f"飞书通知发送成功: {message}")
|
||||
else:
|
||||
logger.error(f"飞书通知发送失败,状态码: {response.status_code},消息: {message}")
|
||||
except requests.exceptions.RequestException as e:
|
||||
logger.error(f"飞书通知发送失败: {e},消息: {message}")
|
Loading…
Add table
Add a link
Reference in a new issue