test-webhook.bat 1.8 KB

123456789101112131415161718192021222324252627282930
  1. @echo off
  2. chcp 65001 >nul
  3. echo ========================================
  4. echo 企微 Webhook 测试脚本
  5. echo ========================================
  6. echo.
  7. :: 生成时间戳作为唯一标识,避免去重
  8. set TS=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%
  9. set TS=%TS: =0%
  10. echo [1/3] 测试群聊消息...
  11. curl -s -X POST http://47.96.148.66/api/qiwe/webhook -H "Content-Type: application/json" -d "{\"code\":0,\"data\":[{\"guid\":\"deploy-test\",\"cmd\":15000,\"msgType\":0,\"fromRoomId\":888777,\"senderId\":168885001,\"msgUniqueIdentifier\":\"grp-%TS%\",\"timestamp\":1716883200,\"msgData\":{\"content\":\"群聊测试消息\",\"atList\":[\"168885002\"]}}],\"msg\":\"success\"}"
  12. echo.
  13. echo [2/3] 测试私聊消息...
  14. curl -s -X POST http://47.96.148.66/api/qiwe/webhook -H "Content-Type: application/json" -d "{\"code\":0,\"data\":[{\"guid\":\"deploy-test\",\"cmd\":15000,\"msgType\":0,\"fromRoomId\":0,\"senderId\":168885001,\"receiverId\":168885002,\"msgUniqueIdentifier\":\"prv-%TS%\",\"timestamp\":1716883200,\"msgData\":{\"content\":\"私聊测试消息\"}}],\"msg\":\"success\"}"
  15. echo.
  16. echo [3/3] 测试群创建(含成员)...
  17. curl -s -X POST http://47.96.148.66/api/qiwe/webhook -H "Content-Type: application/json" -d "{\"code\":0,\"data\":[{\"guid\":\"deploy-test\",\"cmd\":15000,\"msgType\":1006,\"fromRoomId\":999888,\"senderId\":168885001,\"msgUniqueIdentifier\":\"create-%TS%\",\"timestamp\":1716883200,\"base64RawData\":\"MTY4ODg1MDAxOzE2ODg4NTAwMjsxNjg4ODUwMDM=\"}],\"msg\":\"success\"}"
  18. echo.
  19. echo.
  20. echo ========================================
  21. echo 测试完成!
  22. echo 在服务器上查看日志: pm2 logs qiwe-backend --lines 10 --nostream
  23. echo 查看数据库: Parse Dashboard
  24. echo ========================================
  25. pause