查看通过 WebSocket 接收并保存的文本消息
| ID | 时间 | 消息内容 |
|---|---|---|
| 加载中... | ||
/api/messages
limit 可选,每页条数,默认 50,范围 1-200offset 可选,偏移量,默认 0,用于分页
{
"success": true,
"data": {
"total": 100,
"items": [
{
"id": 1,
"content": "hello",
"createdAt": "2026-06-10 12:00:00"
}
]
}
}
{
"success": false,
"message": "查询失败"
}
/ws
// 连接成功
{ "type": "connected", "message": "已连接到 WebSocket 服务,请发送文本消息" }
// 保存成功
{
"type": "saved",
"message": "消息已保存",
"data": { "id": 1, "content": "hello", "createdAt": "2026-06-10 12:00:00" }
}
// 保存失败
{ "type": "error", "message": "消息内容不能为空" }