- 添加FastAPI应用基础结构,包括主入口、路由和模型定义
- 实现Webhook接收端点(/webhook/{namespace})和健康检查(/health)
- 添加管理后台路由和模板,支持端点、目标、渠道和模板管理
- 包含SQLite数据库模型定义和初始化逻辑
- 添加日志记录和统计服务
- 包含Dockerfile和配置示例文件
- 添加项目文档,包括设计、流程图和验收标准
14 lines
501 B
Python
14 lines
501 B
Python
import httpx
|
|
|
|
async def send_feishu(url: str, text: str):
|
|
async with httpx.AsyncClient(timeout=10) as client:
|
|
body = {"msg_type": "text", "content": {"text": text}}
|
|
resp = await client.post(url, json=body)
|
|
resp.raise_for_status()
|
|
|
|
async def send_wecom(url: str, text: str):
|
|
async with httpx.AsyncClient(timeout=10) as client:
|
|
body = {"msgtype": "text", "text": {"content": text}}
|
|
resp = await client.post(url, json=body)
|
|
resp.raise_for_status()
|