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),