| 123456789101112131415161718192021222324252627282930 |
- @echo off
- chcp 65001 >nul
- echo ========================================
- echo 企微 Webhook 测试脚本
- echo ========================================
- echo.
- :: 生成时间戳作为唯一标识,避免去重
- set TS=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%
- set TS=%TS: =0%
- echo [1/3] 测试群聊消息...
- 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\"}"
- echo.
- echo [2/3] 测试私聊消息...
- 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\"}"
- echo.
- echo [3/3] 测试群创建(含成员)...
- 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\"}"
- echo.
- echo.
- echo ========================================
- echo 测试完成!
- echo 在服务器上查看日志: pm2 logs qiwe-backend --lines 10 --nostream
- echo 查看数据库: Parse Dashboard
- echo ========================================
- pause
|