diff --git a/internal/transport/http/docs/openapi.yaml b/internal/transport/http/docs/openapi.yaml index 0ffab20..6820fb6 100644 --- a/internal/transport/http/docs/openapi.yaml +++ b/internal/transport/http/docs/openapi.yaml @@ -173,6 +173,7 @@ info: 5SEND_ACK服务端 → 客户端—仅作 4 的应答 6MESSAGE服务端 → 客户端—envelope,data 为消息 Item(msg_id / content / …) 7PUSH_ACK客户端 → 服务端空;SequenceID=推送帧的 SequenceID无业务响应 + 8READ客户端 → 服务端不是 envelope:conversation_id,以及 msg_id 或 last_msg_id(任一大于 0;两者都大于 0 时用 msg_id)同 8,envelope,code 为 "0",data={"conversation_id","msg_id"}。data.msg_id 是落库后的 last_read_msg_id(只增不减),并清该成员 Redis 未读 9RECALL客户端 → 服务端{"msg_id"}同 9,envelope 10SYNC_INBOX客户端 → 服务端{"mailbox_seq","dialog_score","limit"},均可 0同 10,data.dialogs / mailbox / 游标 12SYNC_MESSAGES客户端 → 服务端{"conversation_id","last_msg_id","limit"}同 12,data.items / has_more @@ -3557,12 +3558,13 @@ components: Frame.Command:1 AUTH 2 HEARTBEAT 3 GENERATE_MSG_ID 4 SEND_MESSAGE 5 SEND_ACK 6 MESSAGE 7 PUSH_ACK 8 READ 9 RECALL 10 SYNC_INBOX 11 SYNC_INBOX_FINISH 12 SYNC_MESSAGES 13 SYNC_MESSAGES_FINISH 14 KICK 15 DELETE_MESSAGE。 - 命令 8 READ 请求体为 `{"conversation_id","msg_id"}`(无信封)。成功应答命令仍为 8, - Body 为 Envelope,`data` 为 `{"conversation_id","msg_id"}`,其中 `msg_id` 是 + 命令 8 READ 请求体不是 envelope:`conversation_id`,以及 `msg_id` 或 `last_msg_id` + (任一大于 0;两者都大于 0 时用 `msg_id`)。成功应答命令仍为 8, + Body 为 Envelope,`code` 为 `"0"`,`data` 为 `{"conversation_id","msg_id"}`,其中 `msg_id` 是 `t_conversation_members.last_read_msg_id`(只增不减)。服务端清该用户 Redis `im:dialog:unreadcnt` 字段,并把会话从 `im:dialog:unread` 挪到 `im:dialog:read`。 水位前进时通知该用户其他在线设备(命令 8,不系统推送、不写 mailbox)。 - 缺 `conversation_id` 或 `msg_id` 时 `code` 为 `40001`。 + 缺 `conversation_id`,或两个消息 id 都小于等于 0 时,`code` 为 `40001`。 EnvelopeCode: type: string enum: ["0", "40001", "40002", "40003", "40004", "40005", "40101", "40102", "40103", "40301", "40302", "40303", "40401", "40402", "40901", "42901", "42902", "42903", "49901", "50001", "50002", "50003", "50301", "50401"]