Skip to content

Commit

Permalink
add EN placeholder docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
mo3et committed Aug 29, 2024
1 parent c70cd6e commit e2a2ec6
Show file tree
Hide file tree
Showing 15 changed files with 1,898 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/sdks/api/friend/getFriendListPage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ values={[

| 参数名称 | 参数类型 | 描述 |
| -------- | --------------------------------------------------- | -------- |
| ~ | List< [FullUserInfo](docs/sdks/class/user/fullUserInfo.mdx) \* > | 成功返回 |
| ~ | List< [FullUserInfo](/sdks/api/friend/docs/sdks/class/user/fullUserInfo.mdx) \* > | 成功返回 |

### 代码示例

Expand Down Expand Up @@ -103,7 +103,7 @@ values={[

| 参数名称 | 参数类型 | 是否必填 | 描述 |
| -------- | -------------------------------------------------------------------------------------------- | -------- | -------- |
| callBack | [OnBase](docs/sdks/callback/onBase.mdx)<List<[UserInfo](docs/sdks/class/user/userInfo.mdx)>> || 回调接口 |
| callBack | [OnBase](/sdks/api/friend/docs/sdks/callback/onBase.mdx)<List<[UserInfo](docs/sdks/class/user/userInfo.mdx)>> || 回调接口 |

### 返回结果

Expand Down
3 changes: 2 additions & 1 deletion docs/sdks/api/user/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ toc_max_heading_level: 2
| ------------------------------------------------------------------------- | ------------------------ |
| [setUserListener](docs/sdks/api/user/setUserListener.mdx) | 用户相关监听 |
| [getSelfUserInfo](docs/sdks/api/user/getSelfUserInfo.mdx) | 获取自己的信息 |
| [setSelfInfo](docs/sdks/api/user/setSelfInfo.mdx) | 设置自己的信息 |
| [setSelfInfo](docs/sdks/api/user/setSelfInfo.mdx) | 设置自己的信息(已弃用) |
| [setSelfInfoEx](docs/sdks/api/user/setSelfInfoEx.mdx) | 设置自己的信息 |
| [getUsersInfoWithCache](docs/sdks/api/user/getUsersInfoWithCache.mdx) | 获取相关用户信息 |
| [subscribeUsersStatus](docs/sdks/api/user/subscribeUsersStatus.mdx) | 订阅用户的在线状态 |
| [unsubscribeUsersStatus](docs/sdks/api/user/unsubscribeUsersStatus.mdx) | 取消订阅用户的在线状态 |
Expand Down
328 changes: 328 additions & 0 deletions docs/sdks/api/user/setSelfInfo.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,328 @@
---
sidebar_position: 3
toc_min_heading_level: 2
toc_max_heading_level: 2
---

# setSelfInfoEx

## 功能介绍

:::info 说明

修改当前登录用户的个人信息。(已弃用,推荐使用setSelfInfoEx)

:::

:::caution 注意




**相关回调**:
[onSelfInfoUpdated](docs/sdks/callback/onSelfUserInfoUpdate.mdx)


:::

<Tabs
groupId="sdks-language"
values={[
{ label: 'iOS', value: 'iOS', },
{ label: 'Android', value: 'Android', },
{ label: 'Flutter', value: 'Flutter', },
{ label: 'uni-app', value: 'uni-app', },
{ label: 'Browser/Electron/MiniProgram', value: 'Web', },
{ label: 'React-Native', value: 'React-Native', },
{ label: 'Unity', value: 'Unity', },
]
}>

<TabItem value="Flutter">

### 函数原型

```dart showLineNumbers
Future<String?> setSelfInfo({
String? nickname,
String? faceURL,
int? appMangerLevel,
String? ex,
String? operationID,
})
```

### 输入参数

| 参数名称 | 参数类型 | 是否必填 | 描述 |
| -------------- | -------- | -------- | -------------- |
| nickname | String? || 用户昵称 |
| faceURL | String? || 用户头像 |
| appMangerLevel | int? || 内部字段,可忽略 |
| ex | String? || 扩展信息 |

### 返回结果

| 参数名称 | 参数类型 | 描述 |
| -------- | -------- | -------------------- |
| ~ | ~ | 无异常抛出则修改成功 |

### 代码示例

```dart showLineNumbers
await OpenIM.iMManager.userManager.setSelfInfo(
nickname: 'lucy',
);
// todo
```

</TabItem>

<TabItem value="iOS">

### 函数原型

```swift showLineNumbers

- (void)setSelfInfo:(OIMUserInfo *)userInfo
onSuccess:(OIMSuccessCallback)onSuccess
onFailure:(OIMFailureCallback)onFailure;

```

### 输入参数

| 参数名称 | 参数类型 | 是否必填 | 描述 |
| -------- | ------------------------------------------------ | -------- | ------------ |
| userInfo | [OIMUserInfo](docs/sdks/class/user/userInfo.mdx) || 用户相关信息 |

### 返回结果

| 参数名称 | 参数类型 | 描述 |
| --------- | ------------------------------------------------------ | -------- |
| onSuccess | OIMSuccessCallback | 成功返回 |
| onFailure | OIMFailureCallback | 失败返回 |

### 代码示例

```swift showLineNumbers

OIMUserInfo *info = [OIMUserInfo new];
info.nickname = @"";
info.faceURL = @"";

[OIMManager.manager setSelfInfo:info
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];

```

</TabItem>

<TabItem value="Android">

### 函数原型

```java showLineNumbers

public void setSelfInfo(OnBase<String> callBack, String nickname, String faceURL, int appMangerLevel, String ex)

```

### 输入参数

| 参数名称 | 参数类型 | 是否必填 | 描述 |
| -------------- | --------------------------------------- | -------- | ------------------------------ |
| callBack | [OnBase](docs/sdks/callback/onBase.mdx) || 回调接口 |
| nickname | String || 名字 |
| faceURL | String || 头像 |
| gender | int || 性别 1:男 2:女 |
| appMangerLevel | int || 内部字段,可忽略 |
| ex | String || 扩展字段 |

### 返回结果

### 代码示例

```java showLineNumbers

OpenIMClient.getInstance().userInfoManager.setSelfInfo(new OnBase<String>(){…},...);

```

</TabItem>

<TabItem value="Web">

### 函数原型

```ts showLineNumbers
IMSDK.setSelfInfo(userInfo: Partial<Omit<SelfUserInfo, 'userID'>>, operationID?: string): Promise<WsResponse>
```

### 输入参数

| 参数名称 | 参数类型 | 是否必填 | 描述 |
| -------- | -------------------------------------------------------------------------- | -------- | -------- |
| userInfo | Partial<Omit<[SelfUserInfo](docs/sdks/class/user/userInfo.mdx), 'userID'>> || 个人信息 |

### 返回结果

| 参数名称 | 参数类型 | 描述 |
| --------------- | ---------------------------------------------------- | ------------ |
| Promise.then() | Promise<[WsResponse](docs/sdks/class/response.mdx)\> | 调用成功回调 |
| Promise.catch() | Promise<[WsResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 |

### 代码示例

```js showLineNumbers
import { getSDK } from 'open-im-sdk-wasm';
const IMSDK = getSDK();

// use in electron with ffi
// import { getWithRenderProcess } from '@openim/electron-client-sdk/lib/render';
// const { instance: IMSDK } = getWithRenderProcess();

// use in mini program
// import { OpenIMSDK } from 'open-im-sdk';
// const IMSDK = new OpenIMSDK();

const userInfo = {
nickname: '', // 要修改的昵称,选填
faceURL: '', // 要修改的头像,选填
ex: '', // 要修改的扩展字段内容,选填
};
IMSDK.setSelfInfo(userInfo)
.then(() => {
// 调用成功
})
.catch(({ errCode, errMsg }) => {
// 调用失败
});
```

</TabItem>

<TabItem value="uni-app">

### 函数原型

```ts showLineNumbers
IMSDK.asyncApi('setSelfInfo', operationID: string, userInfo: Partial<Omit<SelfUserInfo, 'userID'>>): Promise<void>
```

### 输入参数

| 参数名称 | 参数类型 | 是否必填 | 描述 |
| ----------- | -------------------------------------------------------------------------- | -------- | ------------------------------------------------------- |
| operationID | string || 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
| userInfo | Partial<Omit<[SelfUserInfo](docs/sdks/class/user/userInfo.mdx), 'userID'>> || 个人信息 |

### 返回结果

> 通过`openim-uniapp-polyfill`包将函数 Promise 化,调用时需要使用`then``catch`判断并处理成功和失败回调。
| 参数名称 | 参数类型 | 描述 |
| --------------- | ------------------------------------------------------- | ------------ |
| Promise.then() | Promise<void\> | 调用成功回调 |
| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 |

### 代码示例

```js showLineNumbers
import IMSDK from 'openim-uniapp-polyfill';

const userInfo = {
nickname: '', // 要修改的昵称,选填
faceURL: '', // 要修改的头像,选填
ex: '', // 要修改的扩展字段内容,选填
};
IMSDK.asyncApi('setSelfInfo', IMSDK.uuid(), userInfo)
.then(() => {
// 调用成功
})
.catch(({ errCode, errMsg }) => {
// 调用失败
});
```

</TabItem>
<TabItem value="React-Native">

### 函数原型

```ts showLineNumbers
OpenIMSDKRN.setSelfInfo(
userInfo: Partial<Omit<SelfUserInfo, 'userID'>>,
operationID: string
): Promise<void>
```

### 输入参数

| 参数名称 | 参数类型 | 是否必填 | 描述 |
| ----------- | -------------------------------------------------------------------------- | -------- | ------------------------------------------------------- |
| userInfo | Partial<Omit<[SelfUserInfo](docs/sdks/class/user/userInfo.mdx), 'userID'>> || 个人信息 |
| operationID | string || 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |

### 返回结果

| 参数名称 | 参数类型 | 描述 |
| --------------- | ------------------------------------------------------- | ------------ |
| Promise.then() | Promise<void\> | 调用成功回调 |
| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 |

### 代码示例

```js showLineNumbers
import OpenIMSDKRN from "open-im-sdk-rn";

const userInfo = {
nickname: '', // 要修改的昵称,选填
faceURL: '', // 要修改的头像,选填
ex: '', // 要修改的扩展字段内容,选填
};

OpenIMSDKRN.setSelfInfo(userInfo, 'operationID');
.then(() => {
// 调用成功
})
.catch(({ errCode, errMsg }) => {
// 调用失败
});
```

</TabItem>

<TabItem value="Unity">

### 函数原型

```C# showLineNumbers

public static void SetSelfInfo(OnSucOrError cb, UserInfo userInfo);

```

### 输入参数

| 参数名称 | 参数类型 | 是否必填 | 描述 |
| -------------- | --------------------------------------- | -------- | ------------------------------ |
| cb | [OnSucOrError](docs/sdks/callback/OnSucOrError.mdx) || 回调接口 |
| userInfo | [UserInfo](docs/sdks/class/user/userInfo.mdx) || 名字 |

### 返回结果

### 代码示例

```C# showLineNumbers

IMSDK.SetSelfInfo((suc,errCode,errMsg)=>{

},userInfo);

```

</TabItem>
</Tabs>
Loading

0 comments on commit e2a2ec6

Please sign in to comment.