Skip to content

Commit

Permalink
Merge pull request #1067 from haoxiuwen/doc-v2
Browse files Browse the repository at this point in the history
Modify IM Docs
  • Loading branch information
haoxiuwen authored Dec 3, 2024
2 parents 92f8a28 + 4a93f91 commit cbed8b6
Show file tree
Hide file tree
Showing 75 changed files with 190 additions and 52 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified docs/.vuepress/public/images/uikit/chatuikit/web/chat.png
Binary file modified docs/.vuepress/public/images/uikit/chatuikit/web/dark_mode.png
Diff not rendered.
Binary file modified docs/.vuepress/public/images/uikit/chatuikit/web/light_mode.png
10 changes: 10 additions & 0 deletions docs/document/server-side/presence.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ POST https://{host}/{org_name}/{app_name}/users/{username}/presence/{resource}/{
| 参数 | 类型 | 是否必需 | 描述 |
| :-------------- | :----- | :------------ | :------- |
| `Content-Type` | String || 内容类型:`application/json`|
| `Accept` | String || 内容类型。请填 `application/json`|
| `Authorization` | String || App 管理员的鉴权 token,格式为 `Bearer YourAppToken`,其中 `Bearer` 为固定字符,后面为英文空格和获取到的 app token。 |

#### 请求体 body
Expand Down Expand Up @@ -94,6 +95,7 @@ POST https://{host}/{org_name}/{app_name}/users/{username}/presence/{resource}/{
curl -X POST 'a1-test.easemob.com:8089/5101220107132865/test/users/c1/presence/android/0' \
-H 'Authorization: Bearer YWMtnjEbUopPEeybKGMmN0wpeZsaLSh8UEgpirS4wNAM_qx8oS2wik8R7LE4Rclv5hu9AwMAAAF-4tr__wBPGgDWGAeO86wl2lHGeTnU030fpWuEDR015Vk6ULWGYGKccA' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
-d '{"ext":"123"}'
```

Expand Down Expand Up @@ -140,6 +142,7 @@ POST https://{host}/{org_name}/{app_name}/users/{username}/presence/{expiry}
| 参数 | 类型 | 是否必需 | 描述 |
| :-------------- | :----- | :------------------------- | :------- |
| `Content-Type` | String || 内容类型:`application/json`|
| `Accept` | String || 内容类型。请填 `application/json`|
| `Authorization` | String || App 管理员的鉴权 token,格式为 `Bearer YourAppToken`,其中 `Bearer` 为固定字符,后面为英文空格和获取到的 app token。 |

#### 请求 body
Expand Down Expand Up @@ -175,6 +178,7 @@ POST https://{host}/{org_name}/{app_name}/users/{username}/presence/{expiry}
curl -X POST 'a1-test.easemob.com:8089/5101220107132865/test/users/wzy/presence/1000' \
-H 'Authorization: Bearer YWMtnjEbUopPEeybKGMmN0wpeZsaLSh8UEgpirS4wNAM_qx8oS2wik8R7LE4Rclv5hu9AwMAAAF-4tr__wBPGgDWGAeO86wl2lHGeTnU030fpWuEDR015Vk6ULWGYGKccA' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
-d '{"usernames":["c2","c3"]}'
```

Expand Down Expand Up @@ -241,6 +245,7 @@ POST https://{host}/{org_name}/{app_name}/users/{username}/presence
| 参数 | 类型 | 是否必需 | 描述 |
| :-------------- | :----- | :----------------- | :------- |
| `Content-Type` | String || 内容类型。请填 `application/json`|
| `Accept` | String || 内容类型。请填 `application/json`|
| `Authorization` | String || App 管理员的鉴权 token,格式为 `Bearer YourAppToken`,其中 `Bearer` 为固定字符,后面为英文空格和获取到的 app token。 |

#### 请求 body
Expand Down Expand Up @@ -275,6 +280,7 @@ POST https://{host}/{org_name}/{app_name}/users/{username}/presence
curl -X POST 'a1-test.easemob.com:8089/5101220107132865/test/users/wzy/presence' \
-H 'Authorization: Bearer YWMtnjEbUopPEeybKGMmN0wpeZsaLSh8UEgpirS4wNAM_qx8oS2wik8R7LE4Rclv5hu9AwMAAAF-4tr__wBPGgDWGAeO86wl2lHGeTnU030fpWuEDR015Vk6ULWGYGKccA' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
-d '{"usernames":["c2","c3"]}'
```

Expand Down Expand Up @@ -407,6 +413,7 @@ DELETE https://{host}/{org_name}/{app_name}/users/{username}/presence
| 参数 | 类型 | 是否必需 | 描述 |
| :-------------- | :----- | :-------------------------- | :------- |
| `Content-Type` | String || 内容类型。请填 `application/json`|
| `Accept` | String || 内容类型。请填 `application/json`|
| `Authorization` | String || App 管理员的鉴权 token,格式为 `Bearer YourAppToken`,其中 `Bearer` 为固定字符,后面为英文空格和获取到的 app token。 |
### 请求 body

Expand Down Expand Up @@ -434,6 +441,7 @@ DELETE https://{host}/{org_name}/{app_name}/users/{username}/presence
curl -X DELETE 'a1-test.easemob.com:8089/5101220107132865/test/users/wzy/presence' \
-H 'Authorization: Bearer YWMtnjEbUopPEeybKGMmN0wpeZsaLSh8UEgpirS4wNAM_qx8oS2wik8R7LE4Rclv5hu9AwMAAAF-4tr__wBPGgDWGAeO86wl2lHGeTnU030fpWuEDR015Vk6ULWGYGKccA' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '["c1"]'
```

Expand Down Expand Up @@ -486,6 +494,7 @@ GET https://{host}/{org_name}/{app_name}/users/{uid}/presence/sublist?pageNum={p
| 参数 | 类型 | 是否必需 | 描述 |
| :-------------- | :----- | :------- | :----------------------------------------------------------- |
| `Content-Type` | String || 内容类型:`application/json`|
| `Accept` | String || 内容类型。请填 `application/json`|
| `Authorization` | String || App 管理员的鉴权 token,格式为 `Bearer YourAppToken`,其中 `Bearer` 为固定字符,后面为英文空格和获取到的 app token。 |

### HTTP 响应
Expand All @@ -512,6 +521,7 @@ GET https://{host}/{org_name}/{app_name}/users/{uid}/presence/sublist?pageNum={p
curl -X GET 'a1-test.easemob.com:8089/5101220107132865/test/users/wzy/presence/sublist?pageNum=1&pageSize=100' \
-H 'Authorization: Bearer YWMtnjEbUopPEeybKGMmN0wpeZsaLSh8UEgpirS4wNAM_qx8oS2wik8R7LE4Rclv5hu9AwMAAAF-4tr__wBPGgDWGAeO86wl2lHGeTnU030fpWuEDR015Vk6ULWGYGKccA' \
-H 'Content-Type: application/json'
-H 'Accept: application/json'
```

#### 响应示例
Expand Down
20 changes: 15 additions & 5 deletions docs/document/server-side/user_global_mute.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ POST https://{host}/{org_name}/{app_name}/mutes
| 参数 | 类型 | 是否必需 | 描述 |
| :-------------- | :----- | :------- | :----------------------------- |
| `Content-Type` | String || 内容类型。请填 `application/json`|
| `Accept` | String || 内容类型。请填 `application/json`|
| `Authorization` | String || App 管理员的鉴权 token,格式为 `Bearer YourAppToken`,其中 `Bearer` 为固定字符,后面为英文空格和获取到的 app token。 |

##### 请求 body
Expand Down Expand Up @@ -107,6 +108,7 @@ POST https://{host}/{org_name}/{app_name}/mutes
curl -L -X POST 'https://XXXX/XXXX/XXXX/mutes' \
-H 'Authorization: Bearer <YourAppToken>' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"username": "zs1",
"chat": 100,
Expand Down Expand Up @@ -157,13 +159,18 @@ GET https://{host}/{org_name}/{app_name}/mutes/{username}

##### 路径参数

参数及说明详见 [公共参数](#公共参数)
| 参数 | 类型 | 是否必需 | 描述 |
| :---------- | :----- | :------- | :----------------------- |
| `username` | String || 要查询哪个用户的全局禁言详情。 |

其他参数及说明详见 [公共参数](#公共参数)

##### 请求 header

| 参数 | 类型 | 是否必需 | 描述 |
| :-------------- | :----- | :------- | :------------------------------------------------------------------------------------------------------------------- |
| 参数 | 类型 | 是否必需 | 描述 |
| :-------------- | :----- | :------- | :------------------------------------------------------ |
| `Content-Type` | String || 内容类型,请填 `application/json`|
| `Accept` | String || 内容类型。请填 `application/json`|
| `Authorization` | String || App 管理员的鉴权 token,格式为 `Bearer YourAppToken`,其中 `Bearer` 为固定字符,后面为英文空格和获取到的 app token。 |

#### HTTP 响应
Expand Down Expand Up @@ -194,7 +201,8 @@ GET https://{host}/{org_name}/{app_name}/mutes/{username}

curl -L -X GET 'https://XXXX/XXXX/XXXX/mutes/zs1' \
-H 'Authorization: Bearer <YourAppToken>' \
-H 'Content-Type: application/json'
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
```

##### 响应示例
Expand Down Expand Up @@ -257,6 +265,7 @@ GET https://{host}/{org_name}/{app_name}/mutes
| 参数 | 类型 | 是否必需 | 描述 |
| :-------------- | :----- | :------- | :--------------------------------------- |
| `Content-Type` | String || 内容类型。请填 `application/json`|
| `Accept` | String || 内容类型。请填 `application/json`|
| `Authorization` | String || App 管理员的鉴权 token,格式为 `Bearer YourAppToken`,其中 `Bearer` 为固定字符,后面为英文空格和获取到的 app token。 |

#### HTTP 响应
Expand Down Expand Up @@ -287,7 +296,8 @@ GET https://{host}/{org_name}/{app_name}/mutes

curl -L -X GET 'https://XXXX/XXXX/XXXX/mutes?pageNum=1&pageSize=10' \
-H 'Authorization: Bearer <YourAppToken>' \
-H 'Content-Type: application/json'
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
```

##### 响应示例
Expand Down
4 changes: 2 additions & 2 deletions docs/document/server-side/user_relationship.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ GET https://{host}/{org_name}/{app_name}/users/{owner_username}/contacts/users

| 参数 | 类型 | 是否必需 | 描述 |
| :-------------- | :----- | :------- | :------------------------------------------------------------------------------------------------------------------- |
| `Content-Type` | String || 内容类型。请填 `application/json`|
| `Accept` | String || 内容类型。请填 `application/json`|
| `Authorization` | String || App 管理员的鉴权 token,格式为 `Bearer YourAppToken`,其中 `Bearer` 为固定字符,后面为英文空格和获取到的 app token。 |

Expand All @@ -481,6 +480,7 @@ GET https://{host}/{org_name}/{app_name}/users/{owner_username}/contacts/users
# 将 <YourAppToken> 替换为你在服务端生成的 App Token

curl -X GET 'https://XXXX/XXXX/XXXX/users/user1/contacts/users' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YourAppToken>'
```

Expand Down Expand Up @@ -763,7 +763,7 @@ GET https://{host}/{org_name}/{app_name}/users/{owner_username}/blocks/users?pag
| 字段 | 类型 | 描述 |
| :------ | :---- | :----------------------- |
| `data` | Array | 获取的黑名单列表,例如 ["user1", "user2"]|
| `count` | Int | 黑名单上用户的数量|
| `count` | Int | 获取的黑名单上的用户数量|

其他字段及描述详见[公共参数](#公共参数)

Expand Down
15 changes: 10 additions & 5 deletions docs/document/server-side/userprofile.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ GET https://{host}/{org_name}/{app_name}/metadata/user/{username}

| 参数 | 类型 | 是否必需 | 描述 |
| :-------------- | :----- | :------- | :---------- |
| `Content-Type` | String || 内容类型。请填 `application/json`|
| `Accept` | String | | 内容类型。请填 `application/json` |
| `Authorization` | String || App 管理员的鉴权 token,格式为 `Bearer YourAppToken`,其中 `Bearer` 为固定字符,后面为英文空格和获取到的 app token。 |

### HTTP 响应
Expand All @@ -204,7 +204,7 @@ GET https://{host}/{org_name}/{app_name}/metadata/user/{username}
```shell
# 将 <YourAppToken> 替换为你在服务端生成的 App Token

curl -X GET -H 'Content-Type: application/json' -H 'Authorization: Bearer <YourAppToken>' 'https://XXXX/XXXX/XXXX/metadata/user/user1'
curl -X GET -H 'Accept: application/json' -H 'Authorization: Bearer <YourAppToken>' 'https://XXXX/XXXX/XXXX/metadata/user/user1'
```

#### 响应示例
Expand Down Expand Up @@ -254,6 +254,7 @@ POST https://{host}/{org_name}/{app_name}/metadata/user/get
| 参数 | 类型 | 是否必需<div style="width: 80px;"></div> | 描述 |
| :-------------- | :----- | :--------------------- | :--------------- |
| `Content-Type` | String || 内容类型。请填 `application/json`|
| `Accept` | String || 内容类型。请填 `application/json`|
| `Authorization` | String || App 管理员的鉴权 token,格式为 `Bearer YourAppToken`,其中 `Bearer` 为固定字符,后面为英文空格和获取到的 app token。 |

#### 请求 body
Expand Down Expand Up @@ -284,7 +285,10 @@ POST https://{host}/{org_name}/{app_name}/metadata/user/get
```shell
# 将 <YourAppToken> 替换为你在服务端生成的 App Token

curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Bearer <YourAppToken>' -d '{
curl -X POST -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YourAppToken>' \
-d '{
"properties": [
"avatarurl",
"ext",
Expand Down Expand Up @@ -354,6 +358,7 @@ GET https://{host}/{org_name}/{app_name}/metadata/user/capacity

| 参数 | 类型 | 是否必需 | 描述 |
| :-------------- | :----- | :------- | :----------------------------------------- |
| `Accept` | String || 内容类型。请填 `application/json`|
| `Authorization` | String || App 管理员的鉴权 token,格式为 `Bearer YourAppToken`,其中 `Bearer` 为固定字符,后面为英文空格和获取到的 app token。 |

### HTTP 响应
Expand All @@ -377,7 +382,7 @@ GET https://{host}/{org_name}/{app_name}/metadata/user/capacity
```shell
# 将 <YourAppToken> 替换为你在服务端生成的 App Token

curl -X GET -H 'Authorization: Bearer <YourAppToken>' 'https://XXXX/XXXX/XXXX/metadata/user/capacity'
curl -X GET -H 'Accept: application/json' -H 'Authorization: Bearer <YourAppToken>' 'https://XXXX/XXXX/XXXX/metadata/user/capacity'
```

#### 响应示例
Expand Down Expand Up @@ -443,7 +448,7 @@ DELETE https://{host}/{org_name}/{app_name}/metadata/user/{username}
```shell
# 将 <YourAppToken> 替换为你在服务端生成的 App Token

curl -X DELETE -H 'Authorization: Bearer <YourAppToken>' 'https://XXXX/XXXX/XXXX/metadata/user/user1'
curl -X DELETE -H 'Accept: application/json' -H 'Authorization: Bearer <YourAppToken>' 'https://XXXX/XXXX/XXXX/metadata/user/user1'
```

#### 响应示例
Expand Down
21 changes: 17 additions & 4 deletions docs/uikit/chatuikit/android/chatuikit_chat.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@

消息相关功能,详见[功能介绍文档](chatfeature_message.html)

![img](/images/uikit/chatuikit/android/page_chat.png =300x630)
<ImageGallery :columns="3">
<ImageItem src="/images/uikit/chatuikit/android/custom_chat_detail.png" title="聊天页面" />
</ImageGallery>


## 使用示例

Expand Down Expand Up @@ -383,7 +386,9 @@ override fun onDismiss() {
| chatExtendMenu | 获取扩展功能接口。 |
| chatTopExtendMenu | 获取顶部扩展功能接口。 |

![img](/images/uikit/chatuikit/ios/configurationitem/chat/Appearance_chat_input.png)
<ImageGallery>
<ImageItem src="/images/uikit/chatuikit/android/custom_chat_input_bar.png" title="设置输入菜单" />
</ImageGallery>

- 获取输入菜单项对象:

Expand Down Expand Up @@ -424,12 +429,18 @@ binding?.let {

你可以配置聊天页面的标题栏、消息列表项等。以下设置均以使用或继承 `EaseChatFragment` 为前提条件。

![img](/images/uikit/chatuikit/ios/custom_chat.png)
<ImageGallery>
<ImageItem src="/images/uikit/chatuikit/android/custom_chat.png" title="聊天页面" />
</ImageGallery>

### 设置标题栏

聊天页面、会话列表页面、联系人列表页面、群详情页面和联系人详情页面的标题栏均使用 `EaseTitleBar`。如果聊天页面的标题栏不满足需求,建议自定义标题栏。关于标题栏中的标题、头像、背景色、标题栏右侧按钮的显示图片和左侧的头像,详见[设置会话列表页面的标题栏](chatuikit_custom_conversation_list.html#设置标题栏)

<ImageGallery>
<ImageItem src="/images/uikit/chatuikit/android/custom_chat_navigation.png" title="设置标题栏" />
</ImageGallery>

### 设置消息列表项

#### 设置消息列表控件功能
Expand Down Expand Up @@ -615,7 +626,9 @@ builder.setCustomAdapter(CustomMessageAdapter())
EaseIM.getConfig()?.dateFormatConfig?.chatOtherYearFormat = "MMM dd, yyyy HH:mm"
```

![img](/images/uikit/chatuikit/ios/configurationitem/chat/Appearance_chat_dateFormat.png)
<ImageGallery>
<ImageItem src="/images/uikit/chatuikit/android/custom_message_date.png" title="设置消息日期" />
</ImageGallery>

#### 设置消息撤回时间

Expand Down
18 changes: 15 additions & 3 deletions docs/uikit/chatuikit/android/chatuikit_contactlist.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

昵称在中文或者英文的情况下可以实现按首字母分类。

![img](/images/uikit/chatuikit/android/page_contact_list.png =400x850)
<ImageGallery>
<ImageItem src="/images/uikit/chatuikit/android/page_contact_list.png" title="通讯录" />
</ImageGallery>

## 使用示例

Expand All @@ -29,7 +31,9 @@ class ContactListActivity: AppCompactActivity() {

你可以设置联系人页面标题栏、联系人列表 Header 和联系人列表条目。

![img](/images/uikit/chatuikit/android/custom_contact_list.png)
<ImageGallery>
<ImageItem src="/images/uikit/chatuikit/android/custom_contact_list.png" title="联系人列表页面" />
</ImageGallery>

### 通过 EaseContactsListFragment.Builder 自定义

Expand Down Expand Up @@ -158,7 +162,9 @@ builder.setCustomAdapter(CustomContactListAdapter)
builder.setSearchType(EaseSearchType.SELECT_USER)
```

![img](/images/uikit/chatuikit/android/contactlist_configurable.png)
<ImageGallery>
<ImageItem src="/images/uikit/chatuikit/android/contactlist_configurable.png" title="设置成可选择的联系人列表" />
</ImageGallery>

### 设置联系人头像样式

Expand All @@ -174,6 +180,12 @@ builder.setSearchType(EaseSearchType.SELECT_USER)
<color name="ease_avatar_border_color">@color/ease_color_primary</color>
```

<ImageGallery :columns="3">
<ImageItem src="/images/uikit/chatuikit/android/contactlist_avatar_squar.png" title="方形头像" />
<ImageItem src="/images/uikit/chatuikit/android/contactlist_avatar_circle.png" title="圆形头像" />
<ImageItem src="/images/uikit/chatuikit/android/contactlist_avatar_no.png" title="没有头像" />
</ImageGallery>

## 事件监听

```kotlin
Expand Down
Loading

0 comments on commit cbed8b6

Please sign in to comment.