Skip to content

Commit 052ceff

Browse files
committed
Update: /api/v1/conversation
1 parent 9ff8758 commit 052ceff

1 file changed

Lines changed: 83 additions & 0 deletions

File tree

src/api/v1/conversation.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,86 @@ POST /v1/conversation/dismiss-notification
2626
"msg": "success" // 返回信息
2727
}
2828
```
29+
30+
## 获取对话列表
31+
32+
POST /v1/conversation/list
33+
34+
请求头:
35+
|名称|必须|备注|
36+
|-----|-----|-----|
37+
|token|||
38+
39+
响应体:
40+
```ProtoBuf
41+
status {
42+
number: 114514
43+
code: 1
44+
msg: "success"
45+
}
46+
data {
47+
chat_id: "7356666" // 对象ID
48+
chat_type: 1 // 对象类型,1-用户 2-群聊 3-机器人
49+
name: "测试" // 名称
50+
chat_content: "我信(" // 会话内容
51+
timestamp_ms: 1755566778727 // 时间戳(毫秒)
52+
unread_message: 1 // 是否存在未读消息
53+
at: 1 // 是否被@,1表示被@
54+
avatar_id: 12345 // 头像ID
55+
avatar_url: "https://chat-img.jwznb.com/..." // 头像URL
56+
do_not_disturb: 1 // 免打扰,1表示开启
57+
timestamp: 1755566778 // 时间戳(秒)
58+
at_data {
59+
unknown: 123456 // 似乎是名称ID
60+
mentioned_id: "7356666" // 被@的ID
61+
mentioned_name: "测试" // 被@人名称
62+
mentioned_in: "8826666" // @消息所属的对话ID,例如群ID
63+
mentioner_id: "8827777" // 发起@的对象的ID
64+
mentioner_name: "测试" // 发起@的对象的名称
65+
msg_order: 1234 // 消息序列
66+
}
67+
certification_level: 1 // 认证相关,1是官方,2是地区
68+
}
69+
// ...
70+
count: 8 // 会话数目
71+
request_id: "abcdef"
72+
73+
```
74+
::: details ProtoBuf数据结构
75+
```proto
76+
// 列出对话
77+
message list {
78+
Status status = 1;
79+
repeated Data data = 2;
80+
uint64 count = 3; // 列表中对话的数量
81+
string request_id = 4; // 似乎是请求ID
82+
83+
message Data {
84+
string chat_id = 1; // 对象ID
85+
uint64 chat_type = 2; // 对象类型
86+
string name = 3; // 名称
87+
string chat_content = 4; // 消息内容
88+
uint64 timestamp_ms = 5; // 毫秒时间戳
89+
uint64 unread_message = 6; // 1表示有未读消息
90+
uint64 at = 7; // 是否被@
91+
uint64 avatar_id = 8; // 头像ID
92+
string avatar_url = 9; // 头像URL
93+
uint64 do_not_disturb = 11; // 免打扰
94+
uint64 timestamp = 12; // 秒级时间戳
95+
At_data at_data = 14; // @数据
96+
// 15和3重了就不解析了
97+
uint64 certification_level = 16; // 认证,1是官方 2是地区
98+
99+
message At_data {
100+
uint64 unknown = 1; // 似乎是名称ID
101+
string mentioned_id = 2; // 被@的ID,感觉没啥用
102+
string mentioned_name = 3; // 被@的名称,感觉也没啥用
103+
string mentioned_in = 4; // @消息所属的对话ID(例如群ID),感觉还没啥用
104+
string mentioner_id = 6; // 发起@的对象ID
105+
string mentioner_name = 7; // 发起@对象的名称
106+
uint64 msg_order = 8; // 发起@的消息序列
107+
}
108+
}
109+
}
110+
```
111+
:::

0 commit comments

Comments
 (0)