mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-04-22 07:26:46 +00:00
更新文档
This commit is contained in:
@@ -86,6 +86,7 @@ GET /api/v1/push/messages
|
||||
- `sourceName`
|
||||
- `groupName`(仅群聊)
|
||||
- `content`
|
||||
- `timestamp`(消息时间,秒级 Unix 时间戳)
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -97,7 +98,7 @@ curl -N "http://127.0.0.1:5031/api/v1/push/messages?access_token=YOUR_TOKEN
|
||||
|
||||
```text
|
||||
event: message.new
|
||||
data: {"event":"message.new","sessionId":"xxx@chatroom","messageKey":"server:123456:1760000123:1760000123000:321:wxid_member:1","avatarUrl":"https://example.com/group.jpg","sourceName":"李四","groupName":"项目群","content":"[图片]"}
|
||||
data: {"event":"message.new","sessionId":"xxx@chatroom","messageKey":"server:123456:1760000123:1760000123000:321:wxid_member:1","avatarUrl":"https://example.com/group.jpg","sourceName":"李四","groupName":"项目群","content":"[图片]","timestamp":1760000123}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -21,7 +21,6 @@ interface MessagePushPayload {
|
||||
sourceName: string
|
||||
groupName?: string
|
||||
content: string | null
|
||||
eventId: string
|
||||
timestamp: number
|
||||
}
|
||||
|
||||
@@ -331,7 +330,6 @@ class MessagePushService {
|
||||
groupName,
|
||||
sourceName,
|
||||
content,
|
||||
eventId: messageKey,
|
||||
timestamp: createTime
|
||||
}
|
||||
}
|
||||
@@ -346,7 +344,6 @@ class MessagePushService {
|
||||
avatarUrl,
|
||||
sourceName: session.displayName || contactInfo?.displayName || sessionId,
|
||||
content,
|
||||
eventId: messageKey,
|
||||
timestamp: createTime
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4049,7 +4049,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
||||
|
||||
<div className="form-group">
|
||||
<label>推送内容</label>
|
||||
<span className="form-hint">SSE 事件名为 `message.new`;私聊推送 `avatarUrl/sourceName/content`,群聊额外附带 `groupName`</span>
|
||||
<span className="form-hint">SSE 事件名为 `message.new`;私聊推送 `avatarUrl/sourceName/content/timestamp`,群聊额外附带 `groupName`,其中 `timestamp` 为秒级 Unix 时间戳</span>
|
||||
<div className="api-docs">
|
||||
<div className="api-item">
|
||||
<div className="api-endpoint">
|
||||
@@ -4058,7 +4058,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
||||
</div>
|
||||
<p className="api-desc">通过 SSE 长连接接收消息事件,建议接收端按 `messageKey` 去重。</p>
|
||||
<div className="api-params">
|
||||
{['event', 'sessionId', 'sessionType', 'messageKey', 'avatarUrl', 'sourceName', 'groupName?', 'content'].map((param) => (
|
||||
{['event', 'sessionId', 'sessionType', 'messageKey', 'avatarUrl', 'sourceName', 'groupName?', 'content', 'timestamp'].map((param) => (
|
||||
<span key={param} className="param">
|
||||
<code>{param}</code>
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user