From 065a9a4b0623f3decabfe87d8112b0edc39cb611 Mon Sep 17 00:00:00 2001 From: 019825 Date: Sat, 19 Apr 2025 12:51:10 +0800 Subject: [PATCH] add GetGroups and SearchMessage doc (#269) --- .../apis/groupManagement/getGroups.mdx | 117 +++++++++++++ .../apis/messageManagement/searchMessage.mdx | 155 +++++++++++++++++ docs/restapi/commonFields.mdx | 30 ++++ .../apis/groupManagement/getGroups.mdx | 119 +++++++++++++ .../apis/messageManagement/searchMessage.mdx | 157 ++++++++++++++++++ .../current/commonFields.mdx | 33 +++- 6 files changed, 610 insertions(+), 1 deletion(-) create mode 100644 docs/restapi/apis/groupManagement/getGroups.mdx create mode 100644 docs/restapi/apis/messageManagement/searchMessage.mdx create mode 100644 i18n/en/docusaurus-plugin-content-docs-restapi/current/apis/groupManagement/getGroups.mdx create mode 100644 i18n/en/docusaurus-plugin-content-docs-restapi/current/apis/messageManagement/searchMessage.mdx diff --git a/docs/restapi/apis/groupManagement/getGroups.mdx b/docs/restapi/apis/groupManagement/getGroups.mdx new file mode 100644 index 0000000000..f2766f31f3 --- /dev/null +++ b/docs/restapi/apis/groupManagement/getGroups.mdx @@ -0,0 +1,117 @@ +--- +sidebar_position: 22 +title: 获取群列表 +hide_title: true +--- + +
+ + ## 获取群列表 + +
+ +### 简要描述 +- 按指定条件搜索群列表. + +### 请求方式 +- `post` + +### 请求URL +- `{API_ADDRESS}/group/get_groups` + +### Header +|header名|示例值|选填|类型|说明| +|:---- |:------- |:--- |---|------ | +|operationID|1646445464564|必填|string|用于全局链路追踪,建议使用时间戳,在每个请求中独立| +|token|eyJhbxxxx3Xs|必填|string|[管理员 token](docs/restapi/apis/authenticationManagement/getAdminToken.mdx)| + +### 请求参数示例 + +```json +{ + "groupName": "Test", + "groupID": "464588223", + "pagination": { + "pageNumber": 1, + "showNumber": 200 + } +} +``` + +| 字段名 | 选填 | 类型 | 说明 | +|:---------------------|:-------|:--------|:-------------------| +| groupID | 选填 | string | 群ID | +| groupName | 选填 | string | 群名称 | +| pagination | 必填 | object | 分页参数结构体 | +| pagination.pageNumber | 必填 | int | 当前页码,从1开始 | +| pagination.showNumber | 必填 | int | 当前页请求数量 | + +### 成功返回示例 + +```json +{ + "errCode": 0, + "errMsg": "", + "errDlt": "", + "data": { + "total": 1, + "groups": [ + { + "groupInfo": { + "groupID": "464588223", + "groupName": "Test Group Project", + "notification": "", + "introduction": "This is test group", + "faceURL": "", + "ownerUserID": "019825", + "createTime": 1741355328901, + "memberCount": 24, + "ex": "", + "status": 0, + "creatorUserID": "019825", + "groupType": 2, + "needVerification": 0, + "lookMemberInfo": 0, + "applyMemberFriend": 0, + "notificationUpdateTime": 0, + "notificationUserID": "" + }, + "groupOwnerUserName": "", + "groupOwnerUserID": "019825" + } + ] + } +} +``` + +### 成功返回示例的参数说明 + +| 参数名 | 类型 | 说明 | +|:----------------------|:---------|:----------------------------------------------| +| errCode | int | 错误码,0表示成功 | +| errMsg | string | 错误简要信息,为空 | +| errDlt | errDlt | 错误详细信息,为空 | +| data | object | 通用数据对象,具体结构见下方 | +| total | int | 群总数 | +| groups | array | 群列表 | +| groups.groupInfo | object | [群信息对象](docs/restapi/commonFields#groupinfo) | +| groups.groupOwnerUserName | string | 群主名称 | +| groups.groupOwnerUserID | string | 群主ID | + +### 失败返回示例 + +```json +{ + "errCode": 1004, + "errMsg": "RecordNotFoundError", + "errDlt": ": [1004]RecordNotFoundError" +} +``` + +### 失败返回示例的参数说明 + +| 参数名 | 类型 | 说明 | +|:---------------------|:---------|:----------------------------------------| +| errCode | int | 错误码,具体查看全局错误码文档 | +| errMsg | string | 错误简要信息 | +| errDlt | errDlt | 错误详细信息 | diff --git a/docs/restapi/apis/messageManagement/searchMessage.mdx b/docs/restapi/apis/messageManagement/searchMessage.mdx new file mode 100644 index 0000000000..95970c1b74 --- /dev/null +++ b/docs/restapi/apis/messageManagement/searchMessage.mdx @@ -0,0 +1,155 @@ +--- +sidebar_position: 6 +title: 搜索消息 +hide_title: true +--- + +
+ +## 搜索消息 + +
+ +### 简要描述 +- 按照指定条件搜索消息. + +### 请求方式 +- `post` + +### 请求URL +- `{API_ADDRESS}/msg/search_msg` + +### Header +|header名|示例值|选填|类型|说明| +|:---- |:------- |:--- |---|------ | +|operationID|1646445464564|必填|string|用于全局链路追踪,建议使用时间戳,在每个请求中独立| +|token|eyJhbxxxx3Xs|必填|string|[管理员 token](docs/restapi/apis/authenticationManagement/getAdminToken.mdx)| + +### 请求参数示例 + +```json +{ + "sendID": "019825", + "recvID": "464588223", + "contentType": 101, + "sendTime": "2025-04-15", + "sessionType": 3, + "pagination": { + "pageNumber": 1, + "showNumber": 2 + } +} +``` + +| 字段名 | 选填 | 类型 | 说明 | +|:------------------------|:-------|:--------|:-----------------------------------------------------| +| sendID | 选填 | string | 消息发送者ID | +| recvID | 选填 | string | 消息接收者ID | +| contentType | 选填 | int | [消息类型](docs/restapi/contentDescription.mdx) | +| sendTime | 选填 | string | 消息发送时间,检索出该时间以后24小时的消息 | +| sessionType | 选填 | int | Session type, 1: 单聊, 3: 群聊, 4: 系统通知 | +| pagination | 必填 | object | 分页参数结构体 | +| pagination.pageNumber | 必填 | int | 当前页码,从1开始 | +| pagination.showNumber | 必填 | int | 当前页请求数量 | + +### 成功返回示例 + +```json +{ + "errCode": 0, + "errMsg": "", + "errDlt": "", + "data": { + "chatLogs": [ + { + "chatLog": { + "serverMsgID": "df8147686d3d5073e3e25952b7e68f48", + "clientMsgID": "cd2946aa5c3a0780ef145ece226880c6", + "sendID": "019825", + "recvID": "464588223", + "groupID": "464588223", + "recvNickname": "", + "senderPlatformID": 5, + "senderNickname": "xuzhijvn", + "senderFaceURL": "", + "groupName": "Test Group", + "sessionType": 3, + "msgFrom": 100, + "contentType": 101, + "content": "{\"content\":\"dasda\"}", + "status": 2, + "sendTime": 1744676086645, + "createTime": 1744676086155, + "ex": "", + "groupFaceURL": "", + "groupMemberCount": 24, + "seq": 1916, + "groupOwner": "", + "groupType": 2 + }, + "isRevoked": false + }, + { + "chatLog": { + "serverMsgID": "7f5a3528b0f84ac4e15ca203e9a1ac29", + "clientMsgID": "77833db423190b98a2c1fd291c2075f1", + "sendID": "019825", + "recvID": "464588223", + "groupID": "464588223", + "recvNickname": "", + "senderPlatformID": 5, + "senderNickname": "xuzhijvn", + "senderFaceURL": "", + "groupName": "Test Group", + "sessionType": 3, + "msgFrom": 100, + "contentType": 101, + "content": "{\"content\":\"dasdasdasdasd\"}", + "status": 2, + "sendTime": 1744728041741, + "createTime": 1744728041465, + "ex": "", + "groupFaceURL": "", + "groupMemberCount": 24, + "seq": 1925, + "groupOwner": "", + "groupType": 2 + }, + "isRevoked": false + } + ], + "chatLogsNum": 14 + } +} +``` + +### 成功返回示例的参数说明 + +| 参数名 | 类型 | 说明 | +|:-------------------|:---------|:----------------------------------------------| +| errCode | int | 错误码,0表示成功 | +| errMsg | string | 错误简要信息,为空 | +| errDlt | errDlt | 错误详细信息,为空 | +| data | object | 通用数据对象,具体结构见下方 | +| chatLogs | array | 消息列表 | +| chatLogs.chatLog | object | [聊天消息](docs/restapi/contentFields.mdx) | +| chatLogs.isRevoked | bool | 消息是否被撤销 | +| chatLogsNum | int | 消息总数 | + +### 失败返回示例 + +```json +{ + "errCode": 1004, + "errMsg": "RecordNotFoundError", + "errDlt": ": [1004]RecordNotFoundError" +} +``` + +### 失败返回示例的参数说明 + +| 参数名 | 类型 | 说明 | +|:-------------------|:---------|:----------------------------------------| +| errCode | int | 错误码,具体查看全局错误码文档 | +| errMsg | string | 错误简要信息 | +| errDlt | errDlt | 错误详细信息 | diff --git a/docs/restapi/commonFields.mdx b/docs/restapi/commonFields.mdx index a34a9c4ed5..2feec2a808 100644 --- a/docs/restapi/commonFields.mdx +++ b/docs/restapi/commonFields.mdx @@ -187,3 +187,33 @@ title: 常用字段说明 | msgDestructTime | int | | 消息销毁间隔时间 | | latestMsgDestructTime | int | | 消息最后销毁时间 | | isMsgDestruct | boolean | | 是否开启消息定时销毁 | + +## ChatLog + +> 聊天消息. + +| 字段名 | 类型 | 最大字符串长度限制 | 说明 | 取值说明 | +| ------------------- | ------ | ----------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------- | +| serverMsgID | string | | 服务端消息ID | | +| clientMsgID | string | | 客户端消息ID | | +| sendID | string | | 发送者用户ID | | +| recvID | string | | 接收者用户ID | | +| groupID | string | | 群组ID(群消息) | | +| recvNickname | string | | 接收者昵称 | | +| senderPlatformID | int | | 发送者平台ID | | +| senderNickname | string | | 发送者昵称 | | +| senderFaceURL | string | | 发送者头像URL | | +| groupName | string | | 群组名称 | | +| sessionType | int | | 会话类型 | 1: 单聊, 3: 群聊, 4: 系统通知 | +| msgFrom | int | | 消息来源 | 100: 用户消息, 200: 系统消息 | +| contentType | int | | 消息内容类型 | [内容类型](docs/restapi/contentDescription.mdx) | +| content | string | | 消息内容 | | +| status | int | | 消息状态 | 1: 正常消息, 4: 已删除消息 | +| sendTime | int | | 发送时间 | | +| createTime | int | | 创建时间 | | +| ex | string | | 扩展字段 | | +| groupFaceURL | string | | 群组头像URL | | +| groupMemberCount | int | | 群成员数量 | | +| seq | int | | 消息序列号 | | +| groupOwner | string | | 群主ID | | +| groupType | int | | 群组类型 | 固定值为2 | diff --git a/i18n/en/docusaurus-plugin-content-docs-restapi/current/apis/groupManagement/getGroups.mdx b/i18n/en/docusaurus-plugin-content-docs-restapi/current/apis/groupManagement/getGroups.mdx new file mode 100644 index 0000000000..aa81321ed0 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs-restapi/current/apis/groupManagement/getGroups.mdx @@ -0,0 +1,119 @@ +--- +sidebar_position: 22 +title: Get Groups +hide_title: true +--- + +
+ + ## Get Groups + +
+ +### Brief Description +- Retrieves the list of groups. + +### Request Method +- `post` + +### Request URL +- `{API_ADDRESS}/group/get_groups` + +### Header + +| Header Name | Example Value | Optional | Type | Description | +|:------------|:----------------|:---------|:-------|:---------------------------------------------------------------------------| +| operationID | 1646445464564 | Required | string | Used for global trace tracking, suggested to use a unique timestamp per request | +| token | eyJhbxxxx3Xs | Required | string | [Admin token](/restapi/apis/authenticationManagement/getAdminToken) | + +### Request Parameters Example + +```json +{ + "groupName": "Test", + "groupID": "464588223", + "pagination": { + "pageNumber": 1, + "showNumber": 200 + } +} +``` + +| Field Name | Optional | Type | Description | +|:----------------------|:---------|:-------|:-------------------------------------------------------| +| groupID | Optional | string | Group ID | +| groupName | Optional | string | Group Name | +| pagination | Required | object | Pagination parameter structure | +| pagination.pageNumber | Required | int | Current page number, starting from 1 | +| pagination.showNumber | Required | int | Number of items requested per page | + +### Success Response Example + +```json +{ + "errCode": 0, + "errMsg": "", + "errDlt": "", + "data": { + "total": 1, + "groups": [ + { + "groupInfo": { + "groupID": "464588223", + "groupName": "Test Group Project", + "notification": "", + "introduction": "This is test group", + "faceURL": "", + "ownerUserID": "019825", + "createTime": 1741355328901, + "memberCount": 24, + "ex": "", + "status": 0, + "creatorUserID": "019825", + "groupType": 2, + "needVerification": 0, + "lookMemberInfo": 0, + "applyMemberFriend": 0, + "notificationUpdateTime": 0, + "notificationUserID": "" + }, + "groupOwnerUserName": "", + "groupOwnerUserID": "019825" + } + ] + } +} +``` + +### Success Response Parameters Description + +| Parameter Name | Type | Description | +|:--------------------------|:--------|:-----------------------------------------------| +| errCode | int | Error code; 0 indicates success. | +| errMsg | string | Brief error message, empty if none. | +| errDlt | errDlt | Detailed error information, empty if none. | +| data | object | General data object, see structure below | +| total | int | Total number of groups | +| groups | array | List of groups | +| groups.groupInfo | object | [Group Information](/restapi/commonFields#groupinfo) | +| groups.groupOwnerUserName | string | Owner Name of group | +| groups.groupOwnerUserID | string | Owner ID of group | + + +### Failure Response Example + +```json +{ + "errCode": 1004, + "errMsg": "RecordNotFoundError", + "errDlt": ": [1004]RecordNotFoundError" +} +``` + +### Failure Response Parameters Description + +| Parameter Name | Type | Description | +|:---------------|:-------|:------------------------------------------------| +| errCode | int | Error code, refer to global error code documentation | +| errMsg | string | Brief error message | +| errDlt | errDlt | Detailed error information | diff --git a/i18n/en/docusaurus-plugin-content-docs-restapi/current/apis/messageManagement/searchMessage.mdx b/i18n/en/docusaurus-plugin-content-docs-restapi/current/apis/messageManagement/searchMessage.mdx new file mode 100644 index 0000000000..ebbcc8f056 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs-restapi/current/apis/messageManagement/searchMessage.mdx @@ -0,0 +1,157 @@ +--- +sidebar_position: 6 +title: Search Message +hide_title: true +--- + +
+ +## Search Message + +
+ +### Brief Description +- Search message. + +### Request Method +- `post` + +### Request URL +- `{API_ADDRESS}/msg/search_msg` + +### Header + +| Header Name | Example Value | Optional | Type | Description | +|:------------|:----------------|:---------|:-------|:---------------------------------------------------------------------------| +| operationID | 1646445464564 | Required | string | Used for global trace tracking, suggested to use a unique timestamp per request | +| token | eyJhbxxxx3Xs | Required | string | [Admin token](/restapi/apis/authenticationManagement/getAdminToken) | + +### Request Parameters Example + +```json +{ + "sendID": "019825", + "recvID": "464588223", + "contentType": 101, + "sendTime": "2025-04-15", + "sessionType": 3, + "pagination": { + "pageNumber": 1, + "showNumber": 2 + } +} +``` + +| Field Name | Optional | Type | Description | +|:-----------------------|:---------|:-------|:--------------------------------------------------------------| +| sendID | Optional | string | Sender's user ID | +| recvID | Optional | string | Receiver's user ID | +| contentType | Optional | int | [Content type](/restapi/contentDescription) | +| sendTime | Optional | string | Message send time | +| sessionType | Optional | int | Session type, 1: Single chat, 3: Group chat, 4: System notification | +| pagination | Required | object | Pagination parameter structure | +| pagination.pageNumber | Required | int | Current page number, starting from 1 | +| pagination.showNumber | Required | int | Number of items requested per page | + + +### Success Response Example + +```json +{ + "errCode": 0, + "errMsg": "", + "errDlt": "", + "data": { + "chatLogs": [ + { + "chatLog": { + "serverMsgID": "df8147686d3d5073e3e25952b7e68f48", + "clientMsgID": "cd2946aa5c3a0780ef145ece226880c6", + "sendID": "019825", + "recvID": "464588223", + "groupID": "464588223", + "recvNickname": "", + "senderPlatformID": 5, + "senderNickname": "xuzhijvn", + "senderFaceURL": "", + "groupName": "Test Group", + "sessionType": 3, + "msgFrom": 100, + "contentType": 101, + "content": "{\"content\":\"dasda\"}", + "status": 2, + "sendTime": 1744676086645, + "createTime": 1744676086155, + "ex": "", + "groupFaceURL": "", + "groupMemberCount": 24, + "seq": 1916, + "groupOwner": "", + "groupType": 2 + }, + "isRevoked": false + }, + { + "chatLog": { + "serverMsgID": "7f5a3528b0f84ac4e15ca203e9a1ac29", + "clientMsgID": "77833db423190b98a2c1fd291c2075f1", + "sendID": "019825", + "recvID": "464588223", + "groupID": "464588223", + "recvNickname": "", + "senderPlatformID": 5, + "senderNickname": "xuzhijvn", + "senderFaceURL": "", + "groupName": "Test Group", + "sessionType": 3, + "msgFrom": 100, + "contentType": 101, + "content": "{\"content\":\"dasdasdasdasd\"}", + "status": 2, + "sendTime": 1744728041741, + "createTime": 1744728041465, + "ex": "", + "groupFaceURL": "", + "groupMemberCount": 24, + "seq": 1925, + "groupOwner": "", + "groupType": 2 + }, + "isRevoked": false + } + ], + "chatLogsNum": 14 + } +} +``` + +### Success Response Parameters Description + +| Parameter Name | Type | Description | +|:---------------------|:--------|:---------------------------------------------------| +| errCode | int | Error code; 0 indicates success. | +| errMsg | string | Brief error message, empty if none. | +| errDlt | errDlt | Detailed error information, empty if none. | +| data | object | General data object, structure detailed below. | +| chatLogs | array | List of ChatLog | +| chatLogs.chatLog | object | [Chat Log](/restapi/commonFields#chatlog) | +| chatLogs.isRevoked | bool | Whether the message was revoked. | +| chatLogsNum | int | Total number of ChatLog. | + +### Failure Response Example + +```json +{ + "errCode": 1004, + "errMsg": "RecordNotFoundError", + "errDlt": ": [1004]RecordNotFoundError" +} +``` + +### Failure Response Parameters Description + +| Parameter Name | Type | Description | +|:---------------|:-------|:------------------------------------------------| +| errCode | int | Error code, refer to global error code documentation | +| errMsg | string | Brief error message | +| errDlt | errDlt | Detailed error information | diff --git a/i18n/en/docusaurus-plugin-content-docs-restapi/current/commonFields.mdx b/i18n/en/docusaurus-plugin-content-docs-restapi/current/commonFields.mdx index fc46aab519..d0cbead7d8 100644 --- a/i18n/en/docusaurus-plugin-content-docs-restapi/current/commonFields.mdx +++ b/i18n/en/docusaurus-plugin-content-docs-restapi/current/commonFields.mdx @@ -185,4 +185,35 @@ title: Common Fields | maxSeq | int | | Maximum sequence the user can retrieve in this conversation | | msgDestructTime | int | | Interval for message destruction | | latestMsgDestructTime | int | | Latest message destruction timestamp | -| isMsgDestruct | boolean | | Whether timed message destruction is enabled | \ No newline at end of file +| isMsgDestruct | boolean | | Whether timed message destruction is enabled | + + +## ChatLog + +> Chat log. + +| Field Name | Type | Max String Length | Description | Value Description | +| ------------------- | ------ | ----------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------- | +| serverMsgID | string | | Server-side message ID | | +| clientMsgID | string | | Client-side message ID | | +| sendID | string | | Sender's user ID | | +| recvID | string | | Receiver's user ID | | +| groupID | string | | Group ID (for group messages) | | +| recvNickname | string | | Receiver's nickname | | +| senderPlatformID | int | | Sender's platform ID | | +| senderNickname | string | | Sender's nickname | | +| senderFaceURL | string | | Sender's profile picture URL | | +| groupName | string | | Group name | | +| sessionType | int | | Session type | 1: Single chat, 3: Group chat, 4: System notification | +| msgFrom | int | | Message source | 100: User Message, 200: System Message | +| contentType | int | | Content type | [Content type](/restapi/contentDescription.mdx) | +| content | string | | Message content | | +| status | int | | Message status | 1: Normal message, 4: Deleted message | +| sendTime | int | | Message send time | | +| createTime | int | | Message creation time | | +| ex | string | | Extended field | | +| groupFaceURL | string | | Group profile picture URL | | +| groupMemberCount | int | | Number of group members | | +| seq | int | | Message sequence number | | +| groupOwner | string | | Group owner ID | | +| groupType | int | | Group type | Fixed at 2 |