From ad0c894f93987814fe7dcfe6a371170e50d83e89 Mon Sep 17 00:00:00 2001 From: v6ole Date: Fri, 26 Jun 2026 09:49:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=81=E5=BE=AE=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=AB=AF=E7=82=B9=20+=20=E8=B0=83=E5=BA=A6?= =?UTF-8?q?=E5=99=A8=20msgfmt=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 POST /api/wecom/test-message 测试端点(需 director) - 调度器仅推已绑定 wecom_userid 的经理 - wecom.py 已支持 markdown/模板卡片消息 Co-Authored-By: Claude --- backend/app/api/wecom.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/backend/app/api/wecom.py b/backend/app/api/wecom.py index 1b34add..462cdb8 100644 --- a/backend/app/api/wecom.py +++ b/backend/app/api/wecom.py @@ -124,6 +124,19 @@ async def send_announcement( return {"success": success, "sent_to": len(wecom_ids)} +@router.post("/test-message") +async def test_message( + wecom_userid: str, + current_user: dict = Depends(require_director), +): + """Send a test message to a specific wecom_userid for debugging.""" + success = await wecom_client.send_text_message( + [wecom_userid], + "🧪 企迹周报系统 — 测试消息\n\n如果您收到此消息,说明企微消息推送配置成功!" + ) + return {"success": success, "sent_to": wecom_userid} + + @router.post("/trigger-daily-check") async def trigger_daily_check( current_user: dict = Depends(require_director),