diff --git a/buf.yaml b/buf.yaml new file mode 100644 index 00000000..b54736ac --- /dev/null +++ b/buf.yaml @@ -0,0 +1,14 @@ +version: v2 +modules: + - path: . # 表示当前目录(项目根目录)就是一个模块 +lint: + use: + - STANDARD + except: + - PACKAGE_DIRECTORY_MATCH + # 关闭"枚举值必须加前缀"的检查 + - ENUM_VALUE_PREFIX + # 关闭"枚举值必须全大写下划线"的检查 + - ENUM_VALUE_UPPER_SNAKE_CASE + # 关闭"枚举零值必须加 _UNSPECIFIED 后缀"的检查 + - ENUM_ZERO_VALUE_SUFFIX \ No newline at end of file diff --git a/src/.vuepress/theme.ts b/src/.vuepress/theme.ts index 3c162874..21b24a74 100644 --- a/src/.vuepress/theme.ts +++ b/src/.vuepress/theme.ts @@ -2,6 +2,9 @@ import { hopeTheme } from "vuepress-theme-hope"; import navbar from "./navbar.js"; import sidebar from "./sidebar.js"; +import { getDirname, path } from "vuepress/utils"; + +const __dirname = getDirname(import.meta.url); export default hopeTheme({ hostname: "https://yh-api.yyyyt.top", @@ -56,7 +59,14 @@ export default hopeTheme({ gfm: true, imgLazyload: true, imgSize: true, - include: true, + include: { + resolvePath: (file) => { + if (file.startsWith("@src")) + return file.replace("@src", path.resolve(__dirname, "..")); + + return file; + }, + }, mark: true, plantuml: true, spoiler: true, diff --git a/src/api/README.md b/src/api/README.md index f37d87a8..4777650b 100644 --- a/src/api/README.md +++ b/src/api/README.md @@ -5,17 +5,20 @@ title: API ::: warning -- 音频路由: +音频路由: - `https://chat-audio1.jwznb.com/` -- 文件路由: + +文件路由: - `https://chat-file.jwznb.com/` - `https://chat-storage1.jwznb.com/`(有签名校验,无 referer 限制) - `https://chat-file-oss.jwznb.com/`(无 referer 限制,一般 chat-file 的大文件会被重定向到这里) -- 图片路由: + +图片路由: - `https://chat-img.jwznb.com/` - `https://chat-img2.jwznb.com/` - `https://chat-img3.jwznb.com/` -- 视频路由: + +视频路由: - `https://chat-video1.jwznb.com/` 云湖数据床地址需要请求头加上 `Referer: http://myapp.jwznb.com` 才可正常获取内容,否则会403. diff --git a/src/api/v1/msg.md b/src/api/v1/msg.md index ade9648a..ddea8518 100644 --- a/src/api/v1/msg.md +++ b/src/api/v1/msg.md @@ -16,76 +16,11 @@ POST /v1/msg/send-message | token | 是 | 无 | 请求体: -建议参考 proto 文件中的内容. - -```ProtoBuf -msg_id: "abcdef" -chat_id: "114514" -chat_type: 2 -data { - text: "文本内容" - image: "abcdef.jpg" -} -content_type: 2 // 内容类型 -quote_msg_id: "引用消息的 ID" -// media 其实没啥用 +```protobuf + ``` -::: details ProtoBuf 数据结构 - -```proto -// 发送消息 -message send_message_send { - string msg_id = 2; // 信息 ID - string chat_id = 3; // 欲发送到的信息对象 - int64 chat_type = 4; // 欲发送到的信息对象的类别 - Data data = 5; - message Data { - string text = 1; // 信息文本 - string buttons = 2; // 按钮 - string file_name = 4; // 欲发送文件名称 - string file_key = 5; // 欲发送文件 key - repeated string mentioned_id = 6; // @对象 ID ,可以填写多个 - string form = 7; // 表单消息 - string quote_msg_text = 8; // 引用信息文本 - string image = 9; // 欲发送图片 key/url(expression/abcdef.jpg) - string post_id = 10; // 文章ID - string post_title = 11; // 文章标题 - string post_content = 12; // 文章内容 - string post_type = 13; // 文章类型:1-文本,2-Markdown - string expression_id = 15; // 个人表情ID(不知道为啥为STR) - string quote_image_url = 16; // 引用图片直链,https://... - string quote_image_name = 17; // 引用图片文件名称 - int64 file_size = 18; // 欲发送文件大小 - string video = 19; // 欲发送视频 key/url(123.mp4) - string audio = 21; // 语音 key/url(123.m4a) - int64 audio_time = 22; // 语音秒数 - string quote_video_url = 23; // 引用视频直链,https://... - int64 quote_video_time = 24; // 引用视频时长 - int64 sticker_item_id = 25; // 表情 ID - int64 sticker_pack_id = 26; // 表情包 ID - string room_name = 29; // 语音房间发送显示信息的文本 - } - int64 content_type = 6; // 信息类别 - int64 command_id = 7; // 所使用命令 ID - string quote_msg_id = 8; // 引用信息 ID - Media media = 9; - message Media { // 在 media 发送对象为,图片/音频/视频 - string file_key = 1; // 发送对象 key (就是上传后七牛对象存储给你返回的 file_key) - string file_hash = 2; // 发送对象上传返回哈希 - string file_type = 3; // 发送对象类别,image/jpeg-图片,video/mp4-音频 - int64 image_height = 5; // 图片高度 - int64 image_width = 6; // 图片宽度 - int64 file_size = 7; // 发送对象大小 - string file_key2 = 8; // 发送对象key,和1一样,据说不写会报错 - string file_suffix = 9; // 发送对象后缀名 - } -} -``` - -::: - :::: details 发送消息指引 ### 任何消息 @@ -101,12 +36,12 @@ message send_message_send { 可选: -- `data.mentioned_id` -- `data.buttons` # 部分消息填写此项会非常生草 +- `msg_content.mentioned_id` +- `msg_content.buttons` # 部分消息填写此项会非常生草 - `quote_msg_id` # 服务端会自动忽略无效的 `msg_id`,部分消息不支持 -- `data.quote_msg_text` # 可以自定义,服务端不校验,格式: `用户名: 消息内容` -- `data.quote_image_name` # 填写图片 URL(例如说 test.jpg) -- `data.quote_video_url` # 填写引用视频 URL,示例同上 +- `msg_content.quote_msg_text` # 可以自定义,服务端不校验,格式: `用户名: 消息内容` +- `msg_content.quote_image_name` # 填写图片 URL(例如说 test.jpg) +- `msg_content.quote_video_url` # 填写引用视频 URL,示例同上 - `command_id` ::: tabs @@ -115,33 +50,33 @@ message send_message_send { 此处文本类消息指 `普通文本`,`html 消息`,`markdown 消息`. 必填: -- `data.text` +- `msg_content.text` @tab 图片消息 必填: -- `data.image` +- `msg_content.image_url` @tab 文件消息 必填: -- `data.file_key` # 直接填文件 URL,例如 123.bin -- `data.file_size` # 文件大小,服务端不校验,建议如实填写 +- `msg_content.file_key` # 直接填文件 URL,例如 123.bin +- `msg_content.file_size` # 文件大小,服务端不校验,建议如实填写 @tab 视频消息 必填: -- `data.video` # 直接填视频 URL,例如 123.mp4 +- `msg_content.video` # 直接填视频 URL,例如 123.mp4 @tab 语音消息 必填: -- `data.audio` # 语音文件 URL(例如说 test.m4a) -- `data.audio_time` # 语音时长,服务端不校验,建议按照实际填写 +- `msg_content.audio` # 语音文件 URL(例如说 test.m4a) +- `msg_content.audio_time` # 语音时长,服务端不校验,建议按照实际填写 注: 服务端会忽略引用消息相关的参数. @@ -149,16 +84,16 @@ message send_message_send { 必填: -- `data.image` -- `data.expression_id` # 注意 proto 中此项为 str 类型,服务端不校验,建议如实填写否则会导致无法添加/添加表情和图片不一致等问题 +- `msg_content.image` +- `msg_content.expression_id` # 注意 proto 中此项为 str 类型,服务端不校验,建议如实填写否则会导致无法添加/添加表情和图片不一致等问题 @tab 表情包表情 必填: -- `data.image` -- `data.sticker_item_id` # 表情 ID,服务端不校验,建议如实填写,否则会出现不一致/无法添加等问题 -- `data.sticker_pack_id` # 表情包 ID,服务端不校验,建议如实填写否则会出现不一致/无法预览等问题 +- `msg_content.image` +- `msg_content.sticker_item_id` # 表情 ID,服务端不校验,建议如实填写,否则会出现不一致/无法添加等问题 +- `msg_content.sticker_pack_id` # 表情包 ID,服务端不校验,建议如实填写否则会出现不一致/无法预览等问题 @tab 文章消息 @@ -168,31 +103,17 @@ message send_message_send { 必填: -- `data.form` # 具体内容自己抓包看吧 +- `msg_content.form` # 具体内容自己抓包看吧 ::: :::: 响应体: -```ProtoBuf -status { - request_id: 123456 - code: 1 - msg: "success" -} +```protobuf + ``` -::: details ProtoBuf 数据结构 - -```proto -// 信息发送是否成功状态信息 -message send_message { - Status status = 1; // 状态码 -} -``` - -::: ## 编辑消息 @@ -212,59 +133,17 @@ POST /v1/msg/edit-message 请求体: -```ProtoBuf -msg_id: "123456" // 要编辑的消息 ID -chat_id: "big" // 消息所属聊天对象的 ID -chat_type: 2 // 消息所属聊天对象类型 -content { - text: "123" // 文本 - // 剩下的建议看 proto 文件 -} -content_type: 1 // 要编辑为的消息类型 -quote_msg_id: "11451419180" // 引用的消息 ID +```protobuf +// 懒得改名了,就这样吧 + ``` -::: details ProtoBuf 数据结构 - -```proto -// 编辑消息 -message edit_message_send { - string msg_id = 2; - string chat_id = 3; - int32 chat_type = 4; - Content content = 5; - message Content { - string text = 1; // 文本 - string buttons = 2; // 按钮 - string quote_msg_text = 8; // 引用消息文字 - } - uint64 content_type = 6; // 信息类别 - string quote_msg_id = 8; // 引用信息 ID -} -``` - -::: - 响应体: -```ProtoBuf -status { - request_id: 114514 - code: 1 - msg: "success" -} +```protobuf + ``` -::: details ProtoBuf 数据结构 - -```proto -message edit_message { - Status status = 1; -} -``` - -::: - ## 按消息序列列出消息(不包含指定消息) POST /v1/msg/list-message-by-seq @@ -281,149 +160,17 @@ POST /v1/msg/list-message-by-seq 请求体: -```ProtoBuf -msg_start: 1234 // 开始的消息序列 -chat_type: 2 // 对象类型 -chat_id: "big" // 对象 ID -``` - -::: details ProtoBuf 数据结构 - -```proto +```protobuf // 通过消息序列列出消息 -message list_message_by_seq_send { - uint64 msg_start = 3; // 从第 N 个消息开始 - uint64 chat_type = 4; // 对象类型 - string chat_id = 5; // 对象 ID -} + ``` -::: - 响应体: -```ProtoBuf -status { - request_id: 114514 - code: 1 - msg: "success" -} -msg { - msg_id: "abcdef" // 消息 ID - sender { - chat_id: "7356666" // 发送者 ID - chat_type: 1 // 发送者类型。 - name: "测试" // 发送者名称 - avatar_url: "https://chat-img.jwznb.com/..." // 头像 URL - tag_old: "测试成员" // 标签(旧版显示) - // ... - tag { - id: 114514 // 标签 ID - text: "测试成员" // 标签文字 - color: "#FFFFFFFF" // 颜色 - } - // ... - } - direction: "left" // 在聊天中的位置(左边/右边) - content_type: 1 // 消息类型 - content { - text: "ok" // 消息内容 - // 剩下的建议看 ProtoBuf 序列文件,太多不写了 - } - send_time: 123456789 // 发送时间(毫秒时间戳) - cmd { - cmd_id = 123; // 指令ID - name: "指令名" // 指令名 - type: 1 // 指令类型(1-普通指令, 2-直发指令, 5-自定义输入指令) - } - msg_delete_time: 8888 // 消息撤回时间(毫秒时间戳) - quote_msg_id: "abcdef" // 引用消息的 ID - msg_seq: 6666 // 消息序列 - edit_time: 1234 // 最后编辑时间 -} -// ... -total: 23 // 获取的消息数量,貌似最大31个,实际获取的数量是请求中的数量+1 +```protobuf + ``` -::: details ProtoBuf 数据结构 - -```proto -message Tag { - uint64 id = 1; // 标签 ID (貌似) - string text = 3; - string color = 4; -} - -message list_message_by_seq { - Status status = 1; - repeated Msg msg = 2; - uint64 msg_count = 3; // 消息数 - - message Msg { - string msg_id = 1; // 消息 ID - Sender sender = 2; - string direction = 3; // 消息位置,左边/右边 - uint64 content_type = 4; - Content content = 5; - uint64 send_time = 6; // 时间戳(毫秒) - Cmd cmd = 7; // 指令 - uint64 msg_delete_time = 8; // 消息撤回时间 - string quote_msg_id = 9; // 引用消息 ID - uint64 msg_seq = 10; - uint64 edit_time = 12; // 最后编辑时间 - - message Cmd { - uint64 cmd_id = 1; // 指令 ID - string name = 2; // 指令名 - uint64 type = 4; // 指令类型(1-普通指令, 2-直发指令, 5-自定义输入指令) - } - // 消息 - message Content { - string text = 1; // 消息内容 - string buttons = 2; // 按钮 - string image_url = 3; // 图像 URL - string file_name = 4; // 文件名 - string file_url = 5; // 文件 URL - repeated string at = 6; // 被 @ 对象的 ID - string form = 7; // 表单消息 - string quote_msg_text = 8; // 引用消息文字 - string sticker_url = 9; // 表情 URL - string post_id = 10; // 文章 ID - string post_title = 11; // 文章标题 - string post_content = 12; // 文章内容 - string post_content_type = 13; // 文章类型 - string expression_id = 15; // 个人表情 ID (不知道为啥类型为字符串) - string quote_image_url = 16; // 引用图片直链,https://... - string quote_image_name = 17; // 引用图片文件名称 - uint64 file_size = 18; // 文件/图片大小(字节) - string video_url = 19; // 视频 URL - string audio_url = 21; // 语音 URL - uint64 audio_time = 22; // 语音时长 - string quote_video_url = 23; // 引用视频直链,https://... - uint64 quote_video_time = 24; // 引用视频时长 - uint64 sticker_item_id = 25; // 表情 ID - uint64 sticker_pack_id = 26; // 表情包 ID - string call_text = 29; // 语音通话文字 - string call_status_text = 32; // 语音通话状态文字 - uint64 width = 33; // 图片的宽度 - uint64 height = 34; // 图片的高度 - string tip = 37; // 提示信息 - } - // 发送者信息 - message Sender { - string chat_id = 1; // 发送者 ID - uint64 chat_type = 2; // 发送者类型 - string name = 3; // 发送者名称 - string avatar_url = 4; // 头像 URL - repeated string tag_old = 6; // 标签(旧版显示) - repeated Tag tag = 7; // 标签 - } - } -} -``` - -::: - ## 列出消息 POST /v1/msg/list-message @@ -440,151 +187,17 @@ POST /v1/msg/list-message 请求体: -```ProtoBuf -msg_count: 233 // 获取的消息数 -msg_id: "abcdef" // 从指定消息 id 开始,可不写 -chat_type: 2 // 对象类型 -chat_id: "big" // 对象 ID -``` - -::: details ProtoBuf 数据结构 - -```proto -message list_message_send { - uint64 msg_count = 2; // 获取消息数 - string msg_id = 3; // 从指定消息 ID 开始 - uint64 chat_type = 4; // 对象类型 - string chat_id = 5; // 对象 ID -} +```protobuf + ``` -::: - 响应体: 列出的是指定消息 ID 前的消息. -```ProtoBuf -status { - request_id: 114514 - code: 1 - msg: "success" -} -msg { - msg_id: "abcdef" // 消息 ID - sender { - chat_id: "7356666" // 发送者 ID - chat_type: 1 // 发送者类型。 - name: "测试" // 发送者名称 - avatar_url: "https://chat-img.jwznb.com/..." // 头像 URL - tag_old: "测试成员" // 标签(旧版显示) - // ... - tag { - id: 114514 // 标签ID - text: "测试成员" // 标签文字 - color: "#FFFFFFFF" // 颜色 - } - // ... - } - direction: "left" // 在聊天中的位置(左边/右边) - content_type: 1 // 消息类型 - content { - text: "ok" // 消息内容 - // 剩下的建议看 ProtoBuf 序列文件,太多不写了 - } - send_time: 123456789 // 发送时间(毫秒时间戳) - cmd { - cmd_id = 123; // 指令 ID - name: "指令名" // 指令名 - type: 1 // 指令类型(1-普通指令, 2-直发指令, 5-自定义输入指令) - } - msg_delete_time: 8888 // 消息撤回时间(毫秒时间戳) - quote_msg_id: "abcdef" // 引用消息的 ID - msg_seq: 6666 // 消息序列 - edit_time: 1234 // 最后编辑时间 -} -// ... +```protobuf + ``` -::: details ProtoBuf 数据结构 - -```proto -// 标签 -message Tag { - uint64 id = 1; // 标签 ID (貌似) - string text = 3; - string color = 4; -} - -message Msg { - string msg_id = 1; // 消息 ID - Sender sender = 2; - string direction = 3; // 消息位置,左边/右边 - uint64 content_type = 4; - Content content = 5; - uint64 send_time = 6; // 时间戳(毫秒) - Cmd cmd = 7; // 指令 - uint64 msg_delete_time = 8; // 消息撤回时间 - string quote_msg_id = 9; // 引用消息 ID - uint64 msg_seq = 10; - uint64 edit_time = 12; // 最后编辑时间 - - message Cmd { - uint64 cmd_id = 1; // 指令 ID - string name = 2; // 指令名 - uint64 type = 4; // 指令类型(1-普通指令, 2-直发指令, 5-自定义输入指令) - } - // 消息 - message Content { - string text = 1; // 消息内容 - string buttons = 2; // 按钮 - string image_url = 3; - string file_name = 4; - string file_url = 5; - repeated string at = 6; // 被 @ 对象的 ID - string form = 7; // 表单消息 - string quote_msg_text = 8; // 引用消息文字 - string sticker_url = 9; // 表情 URL - string post_id = 10; // 文章 ID - string post_title = 11; // 文章标题 - string post_content = 12; // 文章内容 - string post_content_type = 13; // 文章类型 - string expression_id = 15; // 个人表情 ID (不知道为啥为类型为字符串) - string quote_image_url = 16; // 引用图片直链,https://... - string quote_image_name = 17; // 引用图片文件名称 - uint64 file_size = 18; // 文件/图片大小(字节) - string video_url = 19; // 视频 URL - string audio_url = 21; // 语音 URL - uint64 audio_time = 22; // 语音时长 - string quote_video_url = 23; // 引用视频直链,https://... - uint64 quote_video_time = 24; // 引用视频时长 - uint64 sticker_item_id = 25; // 表情 ID - uint64 sticker_pack_id = 26; // 表情包 ID - string call_text = 29; // 语音通话文字 - string call_status_text = 32; // 语音通话状态文字 - uint64 width = 33; // 图片的宽度 - uint64 height = 34; // 图片的高度 - string tip = 37; // 提示信息 - } - // 发送者信息 - message Sender { - string chat_id = 1; - uint64 chat_type = 2; - string name = 3; - string avatar_url = 4; - repeated string tag_old = 6; - repeated Tag tag = 7; - } -} - -// 获取消息 -message list_message { // 其实可以和 list-message-by-seq 共用的。 - Status status = 1; - repeated Msg msg = 2; -} -``` - -::: - ## 按消息ID列出消息(包含消息id指定的消息) POST /v1/msg/list-message-by-mid-seq @@ -605,157 +218,16 @@ POST /v1/msg/list-message-by-mid-seq 请求体: -```ProtoBuf -msg_seq: 123456 // 开始消息的 seq,不写默认0 -chat_type: 2 // 对象类型 -chat_id: "big" // 对象 ID -unknown: 0 // 不知道干啥的 -msg_count: 10 // 请求获取消息数量 -msg_id: abcdef // 消息 ID +```protobuf + ``` -::: details ProtoBuf 数据结构 - -```proto -// 列出包含请求 msg_id 消息 -message list_message_by_mid_seq_send { - uint64 msg_seq = 3; // 开始消息的 seq - uint64 chat_type = 4; - string chat_id = 5; - uint64 unknown = 6; // 不知道干啥的 - uint64 msg_count = 7; - string msg_id = 8; -} -``` - -::: - 响应体: -```ProtoBuf -status { - request_id: 114514 - code: 1 - msg: "success" -} -msg { - msg_id: "abcdef" // 消息 ID - sender { - chat_id: "7356666" // 发送者 ID - chat_type: 1 // 发送者类型。 - name: "测试" // 发送者名称 - avatar_url: "https://chat-img.jwznb.com/..." // 头像 URL - tag_old: "测试成员" // 标签(旧版显示) - // ... - tag { - id: 114514 // 标签 ID - text: "测试成员" // 标签文字 - color: "#FFFFFFFF" // 颜色 - } - // ... - } - direction: "left" // 在聊天中的位置(左边/右边) - content_type: 1 // 消息类型 - content { - text: "ok" // 消息内容 - // 剩下的建议看 ProtoBuf 序列文件,太多不写了 - } - send_time: 123456789 // 发送时间(毫秒时间戳) - cmd { - cmd_id = 123; // 指令 ID - name: "指令名" // 指令名 - type: 1 // 指令类型(1-普通指令, 2-直发指令, 5-自定义输入指令) - } - msg_delete_time: 8888 // 消息撤回时间(毫秒时间戳) - quote_msg_id: "abcdef" // 引用消息的 ID - msg_seq: 6666 // 消息序列 - edit_time: 1234 // 最后编辑时间 -} -// ... -total: 11 // 获取的消息数量 +```protobuf + ``` -::: details ProtoBuf 数据结构 - -```proto -// 标签 -message Tag { - uint64 id = 1; // 标签 ID (貌似) - string text = 3; - string color = 4; -} - -message Msg { - string msg_id = 1; // 消息 ID - Sender sender = 2; - string direction = 3; // 消息位置,左边/右边 - uint64 content_type = 4; - Content content = 5; - uint64 send_time = 6; // 时间戳(毫秒) - Cmd cmd = 7; // 指令 - uint64 msg_delete_time = 8; // 消息撤回时间 - string quote_msg_id = 9; // 引用消息 ID - uint64 msg_seq = 10; - uint64 edit_time = 12; // 最后编辑时间 - - message Cmd { - uint64 cmd_id = 1; // 指令 ID - string name = 2; // 指令名 - uint64 type = 4; // 指令类型(1-普通指令, 2-直发指令, 5-自定义输入指令) - } - // 消息 - message Content { - string text = 1; // 消息内容 - string buttons = 2; // 按钮 - string image_url = 3; - string file_name = 4; - string file_url = 5; - repeated string at = 6; // 被 @ 对象的 ID - string form = 7; // 表单消息 - string quote_msg_text = 8; // 引用消息文字 - string sticker_url = 9; // 表情 URL - string post_id = 10; // 文章 ID - string post_title = 11; // 文章标题 - string post_content = 12; // 文章内容 - string post_content_type = 13; // 文章类型 - string expression_id = 15; // 个人表情 ID (不知道为啥为类型是字符串) - string quote_image_url = 16; // 引用图片直链,https://... - string quote_image_name = 17; // 引用图片文件名称 - uint64 file_size = 18; // 文件/图片大小(字节) - string video_url = 19; // 视频 URL - string audio_url = 21; // 语音 URL - uint64 audio_time = 22; // 语音时长 - string quote_video_url = 23; // 引用视频直链,https://... - uint64 quote_video_time = 24; // 引用视频时长 - uint64 sticker_item_id = 25; // 表情 ID - uint64 sticker_pack_id = 26; // 表情包 ID - string call_text = 29; // 语音通话文字 - string call_status_text = 32; // 语音通话状态文字 - uint64 width = 33; // 图片的宽度 - uint64 height = 34; // 图片的高度 - string tip = 37; // 提示信息 - } - // 发送者信息 - message Sender { - string chat_id = 1; - uint64 chat_type = 2; - string name = 3; - string avatar_url = 4; - repeated string tag_old = 6; - repeated Tag tag = 7; - } -} - -message list_message_by_mid_seq { - Status status = 1; - repeated Msg msg = 2; - uint64 total = 3; // 消息数 -} - -``` - -::: - ## 获取信息历史编辑内容 POST /v1/msg/list-message-edit-record @@ -811,47 +283,16 @@ POST /v1/msg/button-report 请求体: -```ProtoBuf -msg_id: "123123123123123123" // 信息 ID -chat_type: 2 // 对象类型 -chat_id: "123" // 对象 ID -user_id: "123" // 按钮事件发送者 ID -button_value: "测试按钮文本" // 欲点击按钮的值 +```protobuf + ``` -::: details ProtoBuf 数据结构 - -```proto -// 通过按钮事件点击消息 -message button_report_send { - string msg_id = 2; // 信息 ID - uint64 chat_type = 3; // 对象类型 - string chat_id = 4; // 对象 ID - string user_id = 5; // 按钮事件发送者 ID - string button_value = 6; // 欲点击按钮的值 -} -``` - -::: - 响应体: -列出的是指定消息 ID 前的消息. - -```ProtoBuf -status { - request_id: 114514 - code: 1 - msg: "success" -} -``` ::: details ProtoBuf 数据结构 -```proto -// 按钮事件点击返回状态信息 -message button_report { - Status status = 1; -} +```protobuf + ``` ::: @@ -868,46 +309,16 @@ POST /v1/msg/recall-msg 请求体: -```ProtoBuf -msg_id: "123123123123123123" // 信息 ID -chat_id: "123" // 信息所属对象 ID -chat_type: 2 // 信息所属对象类型 +```protobuf + ``` -::: details ProtoBuf 数据结构 - -```proto -// 通过 msgId 撤回消息 -message recall_msg_send { - string msg_id = 2; // 信息 ID - string chat_id = 3; // 信息所属对象 ID - uint64 chat_type = 4; // 信息所属对象类型 -} -``` - -::: - 响应体: -```ProtoBuf -status { - request_id: 114514 - code: 1 - msg: "success" -} -``` - -::: details ProtoBuf 数据结构 - ```proto -// 撤回消息返回数据 -message recall_msg { - Status status = 1; -} + ``` -::: - ## 批量撤回消息 POST /v1/msg/recall-msg-batch @@ -920,47 +331,16 @@ POST /v1/msg/recall-msg-batch 请求体: -```ProtoBuf -msg_id: "123123123123123123" // 信息 ID -// ... -chat_id: "123" // 信息所属对象 ID -chat_type: 2 // 信息所属对象类型 -``` - -::: details ProtoBuf 数据结构 - -```proto -// 通过 msgId 撤回消息 -message recall_msg_batch_send { - repeated string msg_id = 2; // 信息 ID - string chat_id = 3; // 信息所属对象 ID - uint64 chat_type = 4; // 信息所属对象类型 -} +```protobuf + ``` -::: - 响应体: -```ProtoBuf -status { - request_id: 114514 - code: 1 - msg: "success" -} +```protobuf + ``` -::: details ProtoBuf 数据结构 - -```proto -// 批量信息撤回返回状态 -message recall_msg_batch { - Status status = 1; -} -``` - -::: - ## 文件消息下载记录 POST /v1/msg/file-download-record @@ -1035,40 +415,24 @@ POST v1/msg/pic-list-message-by-mid-seq 请求体: -```ProtoBuf -image_id: 110617 // 图片 id -chat_type: 2 // 会话类型 -chat_id: "418769995" // 会话 id -earlier_quantities: 10 // 前面(消息时间较早)的图片数量 -latest_quantities: 0 // 后面(消息时间较新)的图片数量 +```protobuf + ``` -::: details ProtoBuf 数据结构 - -```proto -meassage pic-list-message-by-mid-seq { - uint64 image_id = 3; // 图片 id - uint64 chat_type = 4; // 会话类型 - string chat_id = 5; // 会话 id - uint64 earlier_quantities = 6; // 前面(消息时间较早)的图片数量 - uint64 latest_quantities = 7; // 后面(消息时间较新)的图片数量 -} -``` - -::: - 响应体: -```proto -// 和 list-message/list-message-by-seq/list-message-by-mid-seq 的 proto 共用 +```protobuf + ``` -## 删除消息(不是撤回) +## 删除消息 ```http request POST /v1/msg/delete ``` +此处是长按消息-删除请求的 API,不是撤回消息的 API. + 请求头: | 名称 | 必须 | 备注 | diff --git a/src/api/v1/user.md b/src/api/v1/user.md index 45ed1438..9ef2a536 100644 --- a/src/api/v1/user.md +++ b/src/api/v1/user.md @@ -61,52 +61,10 @@ GET /v1/user/info 响应体: -```ProtoBuf -status { - request_id: 114514 - code: 1 - msg: "success" -} -data { - id: "123" // 用户 id - name: "测试用户" // 用户名 - avatar_url: "https://..." // 头像 URL - avatar_id: 123 //头像 ID - phone: "12312312300" // 手机号 - email: "123@123.com" // 邮箱 - coin: 123 // 金币数 - is_vip: 0 // 是否为 VIP - vip_expired_time: 1231231230 // VIP 过期时间 - invitation_code: "123" // 邀请码 -} +```protobuf + ``` -::: details ProtoBuf 数据结构 - -```proto -// 用户自身信息 -message info { - - Status status = 1; - message Data { - // 11是描述手机号长整数的,懒得解析了 - string id = 1; // 用户 id - string name = 2; // 用户名 - string avatar_url = 4; // 头像 URL - uint64 avatar_id = 5; // 头像 ID - string phone = 6; // 手机号 - string email = 7; // 邮箱 - double coin = 8; // 金币数 - int32 is_vip = 9; // 是否为 VIP - uint64 vip_expired_time = 10; // VIP 过期时间 - string invitation_code = 12; // 邀请码 - } - Data data = 2; -} -``` - -::: - ## 获取用户信息 POST /v1/user/get-user @@ -119,126 +77,27 @@ POST /v1/user/get-user 请求体: -```ProtoBuf -id: "用户 id" +```protobuf + ``` -::: details ProtoBuf 数据结构 - -```proto -message get_user_send { - string id = 2; -} -``` - -::: - 响应体: -```ProtoBuf -status { - request_id: 123456 - code: 1 - msg: "success" -} -data { - id: "123" // 用户 ID - name: "测试用户" // 用户名 - name_id: 123 // 名称 ID - avatar_url: "https://..." // 头像 URL - avatar_id: 123 // 头像 ID - register_time: "1234-12-12 12:12:12" // 注册时间(YYYY-MM-DD hh:mm:ss) - online_day: 123 // 在线时长 - continuous_online_day: 123 // 连续在线时长 - is_vip: 1 // 是否为 VIP - vip_expired_time: 123123123 // VIP 过期时间(时间戳) - ban_time: 123123123 // 封禁结束时间(时间戳) - medal [ - { - "name": "徽章1", // 徽章名称 - "icon": "徽章1", // ?徽章图标? - "sort": 1, // 徽章顺序(在服务端) - "_id": "id", // ?徽章介绍? - "level": 100, // 等级 - "_level": "level" // ?等级介绍? - }, - { - "name": "徽章2", // 徽章名称 - "icon": "徽章2", // ?徽章图标? - "sort": 3, // 徽章顺序(在服务端) - "_id": "id", // ?徽章介绍? - "level": 500, // 等级 - "_level": "level" // ?等级介绍? - } - ], - "remark_info": { - "date": "", // 备注时间 - "remarks": "" // 备注内容 - }, - "profile_info": { - "flag": 1, // ? - "scoreOrId": 1295971200, - "province": "省(自治区)", // IP 归属地 - "city": "市", // IP 归属地 - "district": "区(县)", // IP归 属地 - }, - "country": "国家或地区" // IP 归属地 -} -``` - -::: details ProtoBuf 数据结构 - -```proto +```protobuf // 勋章信息 -message Medal_info { - uint64 id = 1; // 勋章 ID - string name = 2; // 勋章名称 - uint64 sort = 5; // 勋章顺序 -} + -message Remark_info { - string remark_name = 1; // 备注名 - string phone = 2; // 手机号 - string extra_remark = 3; // 其他备注(格式为 JSON,示例:'[{"key":"他是","value":"我的朋友"},{"key":"职业","value":"打工人"}]' -} +// 备注信息 + -message Profile_info { - string last_active_time = 1; // 该用户上次活跃时间 - string introduction = 2; // 简介 - int32 gender = 3; // 性别(1-男,2-女,3-其他) - uint64 birthday_timestamp = 4; // 生日时间戳 - string city = 5; // 城市 - string district = 6; // 地区 - string address = 7; // 详细地址 -} +// 个人信息 + -// 获取用户信息 -message get_user { - Status status = 1; - Data data = 2; // 数据 - message Data { - string id = 1; // 用户 id - string name = 2; // 用户名 - uint64 name_id = 3; // 名称 ID - string avatar_url = 4; //头像 URL - uint64 avatar_id = 5; // 头像 ID - repeated Medal_info medal = 6; // 勋章信息 - string register_time = 7; // 注册时间,格式: YYYY-MM-DD hh:mm:ss - uint64 ban_time = 10; // 封禁结束时间(时间戳) - uint64 online_day = 11; // 在线天数 - uint64 continuous_online_day = 12; // 连续在线天数 - int32 is_vip = 13; // 是否为 vip - uint64 vip_expired_time = 14; // VIP 过期时间(时间戳) - Remark_info remark_info = 18; // 备注信息 - Profile_info profile_info = 19; // 用户资料信息 - string ip_geo = 20; // IP归属地(国家) - } -} +// 获取用户响应 + ``` -::: - -## 用户勋章 +## 获取自身勋章 POST /v1/user/medal @@ -250,39 +109,15 @@ POST /v1/user/medal 响应体: -```ProtoBuf -status { - request_id: 114514 - code: 1 - msg: "success" -} -medal { - id: 1 // 勋章 ID - name: "测试勋章" // 勋章名称 - sort: 100 // 勋章顺序 -} -``` - -::: details ProtoBuf 数据结构 - -```proto -// 勋章 -message medal { - Status status = 1; - repeated Medal_info medal = 2; // 勋章信息 -} +```protobuf +// 获取自身勋章 + // 勋章信息 -message Medal_info { - uint64 id = 1; // 勋章 ID - string name = 2; // 勋章名称 - uint64 sort = 5; // 勋章顺序 -} + ``` -::: - -## 更改用户名称 +## 更改自身名称 POST /v1/user/edit-nickname @@ -294,42 +129,18 @@ POST /v1/user/edit-nickname 请求体: -```ProtoBuf -name: "123" // 用户名称 +```protobuf + ``` -::: details ProtoBuf 数据结构 - -```proto -message edit_nickname_send { - string name = 3; -} -``` - -::: - 响应体: -```ProtoBuf -status { - request_id: 114514 - code: 1 - msg: "success" -} +```protobuf + ``` -::: details ProtoBuf 数据结构 -```proto -// 更改名称状态信息 -message edit_nickname { - Status status = 1; -} -``` - -::: - -## 更改用户头像 +## 更改自身头像 POST /v1/user/edit-avatar @@ -341,40 +152,16 @@ POST /v1/user/edit-avatar 请求体: -```ProtoBuf -url: "https://..." // 用户头像 url -``` - -::: details ProtoBuf 数据结构 - -```proto -message edit_avatar_send { - string url = 2; -} +```protobuf + ``` -::: - 响应体: -```ProtoBuf -status { - request_id: 114514 - code: 1 - msg: "success" -} -``` - -::: details ProtoBuf 数据结构 - -```proto -// 更改名称状态信息 -message edit_avatar { - Status status = 1; -} +```protobuf + ``` -::: ## 用户邮箱密码登录 @@ -497,7 +284,7 @@ POST /v1/user/recommend-list "data": { "groupList": [ { - "chatId": "123", // 群聊 id + "chatId": "123", // 群聊 ID "banId": 0, // 顾名思义 "nickname": "测试群聊名称", // 群聊名字 "introduction": "测试群聊简介", // 群聊介绍 @@ -530,7 +317,7 @@ POST /v1/user/recommend "data": { "botList": [ { - "chatId": "123", // 机器人 id + "chatId": "123", // 机器人 ID "chatType": "3", // 识别对象类别,1-用户,2-群聊,3-机器人 "headcount": "123", // 使用人数 "nickname": "测试机器人名称", // 机器人名称 @@ -573,11 +360,11 @@ POST /v1/user/module-ignore-info "code": 1, "data": { "ignore": { - "id": 0, // 可能是模块设置 id - "userId": "1234567", // 用户 id + "id": 0, // 可能是模块设置 ID + "userId": "1234567", // 用户 ID "updateTime": 123455660, // 更新时间戳 - "deviceId": "1234", // 设备 id - "ignore": ",30,20,10" // 模块id: 10-隐藏社区页面,20-隐藏发现页面,30-精简我的界面 + "deviceId": "1234", // 设备 ID + "ignore": ",30,20,10" // 模块 ID: 10-隐藏社区页面,20-隐藏发现页面,30-精简我的界面 } }, "msg": "success" @@ -599,7 +386,7 @@ POST /v1/user/module-ignore ```JSON { "deviceId": "1234", - "ignore": ",30,20,10" // 模块id,10-隐藏社区页面,20-隐藏发现页面,30-精简我的界面 + "ignore": ",30,20,10" // 模块 ID,10-隐藏社区页面,20-隐藏发现页面,30-精简我的界面 } ``` @@ -626,8 +413,8 @@ POST /v1/user/notification-status ```JSON { - "deviceId": "1114514", // 设备id - "registrationId": "114514" // 注册id + "deviceId": "1114514", // 设备 ID + "registrationId": "114514" // 注册 ID } ``` @@ -637,11 +424,11 @@ POST /v1/user/notification-status { "code": 1, "data": { - "notification": { // 通知 json - "id": 110061, // 注册 id - "userId": "114514", // 用户 id - "deviceId": "114514", // 设备 id - "registrationId": "114514", // 通知注册 id + "notification": { // 通知 JSON + "id": 110061, // 注册 ID + "userId": "114514", // 用户 ID + "deviceId": "114514", // 设备 ID + "registrationId": "114514", // 通知注册 ID "isOpen": 1, // 是否打开系统消息通知(设置”系统消息通知“选项可控制这个数值,1-打开,0-关闭) "type": 2, // 类型 "delFlag": 0, @@ -667,8 +454,8 @@ POST /v1/user/notification-info ```JSON { - "deviceId": "114514", // 设备 id - "registrationId": "114514", // 注册通知 id + "deviceId": "114514", // 设备 ID + "registrationId": "114514", // 注册通知 ID "isOpen": 1, // // 是否打开系统消息通知(设置”系统消息通知“选项可控制这个数值,1-打开,0-关闭) "type": 2 // 类型 } @@ -697,7 +484,7 @@ POST /v1/user/gold-coin-increase-decrease-record ```JSON { - "size": 20, // 尺寸 + "size": 20, // 单页数目 "page": 1 // 页数 } ``` @@ -710,8 +497,8 @@ POST /v1/user/gold-coin-increase-decrease-record "data": { "goldCoinRecord": [ { - "id": 193275, // 金币记录 id - "userId": "用户 id", + "id": 193275, // 金币记录 ID + "userId": "用户 ID", "typ": 8, // 类型 "beforeAmount": 55.01, // 之前金币数量 "afterAmount": 57.01, // 之后的金币数量 diff --git a/src/api/wss/chat-ws-go.jwzhd.com.md b/src/api/wss/chat-ws-go.jwzhd.com.md index 056a99b0..da222b43 100644 --- a/src/api/wss/chat-ws-go.jwzhd.com.md +++ b/src/api/wss/chat-ws-go.jwzhd.com.md @@ -272,20 +272,6 @@ message push_message { ::: -### 消息类型列表 - -- `1`: 文本消息 -- `2`: 图片消息 -- `3`: Markdown 消息 -- `4`: 文件消息 -- `6`: 帖子消息 -- `7`: 表情消息 -- `8`: HTML 消息 -- `10`: 视频消息 -- `11`: 语音消息 -- `13`: 语音通话 -- `14`: A2UI 消息 - ## 推送超级文件分享 ### 返回数据 diff --git a/src/full.proto b/src/full.proto new file mode 100644 index 00000000..632cd452 --- /dev/null +++ b/src/full.proto @@ -0,0 +1,329 @@ +syntax = "proto3"; + +// buf:lint:ignore PACKAGE_DIRECTORY_MATCH +// buf:lint:ignore PACKAGE_VERSION_SUFFIX +package yh; + +// 共用区 + +// 枚举 + +enum ChatType { + unknown1 = 0; + user = 1; + group = 2; + bot = 3; +} + +enum ContentType { + unknown = 0; + text = 1; + image = 2; + markdown = 3; + file = 4; + form = 5; + sticker = 7; + html = 8; + audio = 11; + call = 13; + a2ui = 14; +} + +// 枚举结束 + +// 响应状态 +// #region Status +message Status { + int64 request_id = 1; + int32 code = 2; + string msg = 3; +} +// #endregion Status + +// 勋章信息 +// #region MedalInfo +message MedalInfo { + uint64 id = 1; // 勋章 ID + string name = 2; // 勋章名称 + uint64 sort = 5; // 勋章顺序 +} +// #endregion MedalInfo + +// 备注信息 +// #region RemarkInfo +message RemarkInfo { + string remark_name = 1; // 备注名 + string phone = 2; // 手机号 + string extra_remark = 3; // 其他备注(格式为 JSON,示例:'[{"key":"他是","value":"我的朋友"},{"key":"职业","value":"打工人"}]' +} +// #endregion RemarkInfo + +// 个人信息 +// #region ProfileInfo +message ProfileInfo { + string last_active_time = 1; // 该用户上次活跃时间 + string introduction = 2; // 简介 + int32 gender = 3; // 性别(1-男,2-女,3-其他) + uint64 birthday_timestamp = 4; // 生日时间戳 + string city = 5; // 城市 + string district = 6; // 地区 + string address = 7; // 详细地址 +} +// #endregion ProfileInfo + +// 通用状态响应 +// #region StatusResponse +message StatusResponse { + Status status = 1; +} +// #endregion StatusResponse + +// 消息内容 +// #region MsgContent +message MsgContent { + string text = 1; // 信息文本 + string buttons = 2; // 按钮 + string image_url = 3; // 图片 URL + string file_name = 4; // 欲发送文件名称 + string file_url = 5; // 欲发送文件 URL + repeated string mentioned_id = 6; // @对象 ID ,可以填写多个 + string form = 7; // 表单消息 + string quote_msg_text = 8; // 引用信息文本 + string image = 9; // 欲发送图片 key/url(expression/abcdef.jpg) + string post_id = 10; // 文章ID + string post_title = 11; // 文章标题 + string post_content = 12; // 文章内容 + string post_content_type = 13; // 文章类型: 1-文本,2-Markdown + string expression_id = 15; // 个人表情ID(不知道为啥为STR) + string quote_image_url = 16; // 引用图片直链,https://... + string quote_image_name = 17; // 引用图片文件名称 + int64 file_size = 18; // 欲发送文件大小 + string video_url = 19; // 欲发送视频 key/url(123.mp4) + string audio_url = 21; // 语音 key/url(123.m4a) + int64 audio_time = 22; // 语音时长(单位秒) + string quote_video_url = 23; // 引用视频直链,https://... + int64 quote_video_time = 24; // 引用视频时长 + int64 sticker_item_id = 25; // 表情 ID + int64 sticker_pack_id = 26; // 表情包 ID + string room_name = 29; // 语音房间发送显示信息的文本 + string call_status_text = 32; // 语音通话状态文字 + uint64 width = 33; // 图片的宽度 + uint64 height = 34; // 图片的高度 + string tip = 37; // 提示信息 +} +// #endregion MsgContent + +// 标签 +// #region Tag +message Tag { + uint64 id = 1; // 标签 ID (貌似) + string text = 3; + string color = 4; +} +// #endregion Tag +// 共用区结束 + +// User 相关 + +// 获取用户自身信息 +// #region UserInfo +message UserInfo { + Status status = 1; + message Data { + // 11是描述手机号长整数的,懒得解析了 + string id = 1; // 用户 ID + string name = 2; // 用户名 + string avatar_url = 4; // 头像 URL + int64 avatar_id = 5; // 头像 ID + string phone = 6; // 手机号 + string email = 7; // 邮箱 + double coin = 8; // 金币数 + bool is_vip = 9; // 是否为 VIP + int64 vip_expired_time = 10; // VIP 过期时间 + string invitation_code = 12; // 邀请码 + } + + Data data = 2; +} +// #endregion UserInfo + +// 获取用户信息 +// #region GetUserRequest +message GetUserRequest { + string id = 2; +} +// #endregion GetUserRequest + +// #region GetUserResponse +message GetUserResponse { + Status status = 1; + Data data = 2; // 数据 + message Data { + string id = 1; // 用户 id + string name = 2; // 用户名 + uint64 name_id = 3; // 名称 ID + string avatar_url = 4; //头像 URL + uint64 avatar_id = 5; // 头像 ID + repeated MedalInfo medal = 6; // 勋章信息 + string register_time = 7; // 注册时间,格式: YYYY-MM-DD hh:mm:ss + uint64 ban_time = 10; // 封禁结束时间(时间戳) + uint64 online_day = 11; // 在线天数 + uint64 continuous_online_day = 12; // 连续在线天数 + bool is_vip = 13; // 是否为 vip + uint64 vip_expired_time = 14; // VIP 过期时间(时间戳) + RemarkInfo remark_info = 18; // 备注信息 + ProfileInfo profile_info = 19; // 用户资料信息 + string ip_geo = 20; // IP归属地(国家) + } +} +// #endregion GetUserResponse + +// 获取自身勋章 +// #region GetSelfMedal +message GetSelfMedal { + Status status = 1; + repeated MedalInfo medal = 2; // 勋章信息 +} +// #endregion GetSelfMedal + +// 编辑自身昵称 +// #region EditNicknameRequest +message EditNicknameRequest { + string name = 3; // 修改后的名称 +} +// #endregion EditNicknameRequest + +// 更改自身头像 +// #region EditAvatarRequest +message EditAvatarRequest { + string url = 2; // 完整 URL(https://...) +} +// #endregion EditAvatarRequest + +// Msg 相关 + +// 发送消息 +// #region SendMsgRequest +message SendMsgRequest { + string msg_id = 2; // 信息 ID + string chat_id = 3; // 欲发送到的信息对象 + ChatType chat_type = 4; // 欲发送到的信息对象的类别 + MsgContent msg_content = 5; // 消息内容 + ContentType content_type = 6; // 消息类别 + int64 command_id = 7; // 所使用命令 ID + string quote_msg_id = 8; // 引用信息 ID + // Media media = 9; // 其实没啥用,不要看这个!!!!! + // message Media { // 在 media 发送对象为,图片/音频/视频 + // string file_key = 1; // 发送对象 key (就是上传后七牛对象存储给你返回的 file_key) + // string file_hash = 2; // 发送对象上传返回哈希 + // string file_type = 3; // 发送对象类别,image/jpeg-图片,video/mp4-音频 + // int64 image_height = 5; // 图片高度 + // int64 image_width = 6; // 图片宽度 + // int64 file_size = 7; // 发送对象大小 + // string file_key2 = 8; // 发送对象key,和1一样,据说不写会报错 + // string file_suffix = 9; // 发送对象后缀名 + // } +} +// #endregion SendMsgRequest + +// 编辑消息的 Proto 可以和 SendMsg 共用,这里不写了 + +// 通过消息序列列出消息 +// #region ListMsgBySeqRequest +message ListMsgBySeqRequest { + uint64 msg_start = 3; // 从第 N 个消息开始 + ChatType chat_type = 4; // 对象类型 + string chat_id = 5; // 对象 ID +} +// #endregion ListMsgBySeqRequest + +// #region ListMsgResponse +message ListMsgResponse { + Status status = 1; + repeated MsgData msg_data = 2; // 消息 + uint64 total = 3; // 消息数 + + message MsgData { + string msg_id = 1; // 消息 ID + Sender sender = 2; + string direction = 3; // 消息位置,左边/右边 + ContentType content_type = 4; + MsgContent msg_content = 5; + uint64 send_time = 6; // 时间戳(毫秒) + Cmd cmd = 7; // 指令 + uint64 recall_time = 8; // 消息撤回时间 + string quote_msg_id = 9; // 引用消息 ID + uint64 msg_seq = 10; + uint64 edit_time = 12; // 最后编辑时间 + + message Cmd { + uint64 cmd_id = 1; // 指令 ID + string name = 2; // 指令名 + uint64 type = 4; // 指令类型(1-普通指令, 2-直发指令, 5-自定义输入指令) + } + + // 发送者信息 + message Sender { + string chat_id = 1; // 发送者 ID + ChatType chat_type = 2; // 发送者类型 + string name = 3; // 发送者名称 + string avatar_url = 4; // 头像 URL + repeated string tag_old = 6; // 标签(旧版显示) + repeated Tag tag = 7; // 标签 + } + } +} +// #endregion ListMsgResponse + +// 通过列出消息 +// #region ListMsgRequest +message ListMsgRequest { + uint64 msg_count = 2; // 获取消息数 + string msg_id = 3; // 从指定消息 ID 开始 + ChatType chat_type = 4; // 对象类型 + string chat_id = 5; // 对象 ID +} +// #endregion ListMsgRequest + +// 列出包含请求 msg_id 消息 +// #region ListMsgByMidSeqRequest +message ListMsgByMidSeqRequest { + uint64 msg_seq = 3; // 开始消息的 seq + ChatType chat_type = 4; + string chat_id = 5; + uint64 unknown = 6; // 不知道干啥的 + uint64 msg_count = 7; + string msg_id = 8; +} +// #endregion ListMsgByMidSeqRequest + +// 按钮事件回调消息 +// #region ButtonReportRequest +message ButtonReportRequest { + string msg_id = 2; // 消息 ID + ChatType chat_type = 3; // 对象类型 + string chat_id = 4; // 对象 ID + string user_id = 5; // 按钮事件发送者 ID + string button_value = 6; // 欲点击按钮的值 +} +// #endregion ButtonReportRequest + +// 撤回消息 +// #region RecallMsg +message RecallMsg { + repeated string msg_id = 2; // 要撤回的信息 ID + string chat_id = 3; // 信息所属对象 ID + ChatType chat_type = 4; // 信息所属对象类型 +} +// #endregion RecallMsg + +// 获取消息列表内的图片 +// #region PicListMsgByMidSeqRequest +message PicListMsgByMidSeqRequest { + uint64 image_id = 3; // 图片 ID + ChatType chat_type = 4; // 会话类型 + string chat_id = 5; // 会话 ID + uint64 earlier_quantities = 6; // 前面(消息时间较早)的图片数量 + uint64 latest_quantities = 7; // 后面(消息时间较新)的图片数量 +} +// #endregion PicListMsgByMidSeqRequest