Skip to content

Commit e0f27b1

Browse files
authored
feat: add setGroupInfoEX interface (#155)
1 parent 5cca192 commit e0f27b1

18 files changed

Lines changed: 693 additions & 12 deletions

docs/restapi/apis/groupManagement/getRecvGroupApplicationList.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 18
2+
sidebar_position: 19
33
title: 获取收到的入群申请
44
hide_title: true
55
---

docs/restapi/apis/groupManagement/getUserReqGroupApplicationList.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 20
2+
sidebar_position: 21
33
title: 获取发起的入群申请
44
hide_title: true
55
---

docs/restapi/apis/groupManagement/groupApplicationResponse.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 19
2+
sidebar_position: 20
33
title: 处理入群申请
44
hide_title: true
55
---

docs/restapi/apis/groupManagement/muteGroupMember.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 21
2+
sidebar_position: 22
33
title: 禁言群成员
44
hide_title: true
55
---

docs/restapi/apis/groupManagement/quitGroup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 17
2+
sidebar_position: 18
33
title: 退出群组
44
hide_title: true
55
---

docs/restapi/apis/groupManagement/setGroupInfo.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ hide_title: true
1111
</center>
1212

1313
### 简要描述
14-
- 修改群组信息。
14+
- 修改群组信息。(此接口已弃用,建议使用`set_group_info_ex`
1515
### 请求方式
1616
- `post`
1717
### 请求URL
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
sidebar_position: 17
3+
title: 修改群组信息EX
4+
hide_title: true
5+
---
6+
7+
<center>
8+
9+
## 修改群组信息EX
10+
11+
</center>
12+
13+
### 简要描述
14+
- 修改群组信息。(如果使用此接口,请使用 **[设置群组信息EX之前的回调](docs/restapi/webhooks/group/setGroupInfoEXBefore.mdx)****[设置群组信息EX之后的回调](docs/restapi/webhooks/group/setGroupInfoEXAfter.mdx)**。)
15+
### 请求方式
16+
- `post`
17+
### 请求URL
18+
- `http://x.x.x.x:10002/group/set_group_info`
19+
20+
21+
### Header
22+
|header名|示例值|选填|类型|说明|
23+
|:---- |:------- |:--- |---|------ |
24+
|operationID|1646445464564|必填|string|operationID用于全局链路追踪|
25+
|token|eyJhbxxxx3Xs|必填|string|管理员token|
26+
27+
28+
### 请求参数示例
29+
30+
31+
```json
32+
{
33+
"groupInfoForSet": {
34+
"groupID": "xadxwr24",
35+
"groupName": "new name",
36+
"notification": "new notification",
37+
"introduction": "new introduction",
38+
"faceURL": "www.newfaceURL.com",
39+
"ex": "new ex",
40+
"needVerification": 1,
41+
"lookMemberInfo": 1,
42+
"applyMemberFriend": 1
43+
}
44+
}
45+
```
46+
|字段名|选填|类型|说明|
47+
|:---- |:------- |:--- |---|
48+
|groupInfoForSet|必填|object|群信息对象|
49+
|groupInfoForSet.groupID|必填|string|要修改的群ID|
50+
|groupInfoForSet.groupName|选填|string|新群名|
51+
|groupInfoForSet.notification|选填|string|新群公告|
52+
|groupInfoForSet.introduction|选填|string|新群介绍|
53+
|groupInfoForSet.faceURL|选填|string|新群头像|
54+
|groupInfoForSet.ex|选填|string|新群扩展字段|
55+
|groupInfoForSet.needVerification|选填|int|进群是否需要验证;0:申请加入群需要同意,成员邀请可直接进群,1:所有人进群需要验证,除了群主管理员邀请进群,2:直接进群|
56+
|groupInfoForSet.lookMemberInfo|选填|int|是否能查看其他群成员信息;0:允许查看群成员信息,1:不允许查看群成员信息|
57+
|groupInfoForSet.applyMemberFriend|选填|int|群成员是否能添加好友;0:允许从群成员处添加好友,1:不允许添加|
58+
### 成功返回示例
59+
60+
61+
```json
62+
{
63+
"errCode": 0,
64+
"errMsg": "",
65+
"errDlt": ""
66+
}
67+
```
68+
### 成功返回示例的参数说明
69+
70+
71+
|参数名|类型|说明|
72+
|:---- |:------- |:--- |
73+
|errCode|int|错误码,0表示成功|
74+
|errMsg|string|错误简要信息,无错误时为空|
75+
|errDlt|errDlt|错误详细信息,无错误时为空|
76+
|data|object|通用数据对象,具体结构见下方|
77+
### 失败返回示例
78+
79+
80+
```json
81+
{
82+
"errCode": 1004,
83+
"errMsg": "RecordNotFoundError",
84+
"errDlt": ": [1004]RecordNotFoundError"
85+
}
86+
```
87+
### 失败返回示例的参数说明
88+
89+
90+
|参数名|类型|说明|
91+
|:---- |:------- |:--- |
92+
|errCode|int|错误码,具体查看全局错误码文档|
93+
|errMsg|string|错误简要信息|
94+
|errDlt|errDlt|错误详细信息|
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: 设置群组信息EX之后的回调
3+
hide_title: true
4+
---
5+
6+
# 设置群组信息EX之后的回调
7+
8+
## 功能说明
9+
App 业务服务端可以通过该回调实时查看群资料的变更,包括:通知 App 后台成员入群,包括对变动群组资料的实时记录(例如记录日志,或者同步到其他系统)。
10+
11+
## 注意事项
12+
- 为启用回调,必须配置回调 URL,并开启本条回调协议对应的开关。配置方法详见 [回调说明](../introduction) 文档。
13+
- 回调的方向是 OpenIMServer 向 App 后台发起 HTTP/HTTPS POST 请求。
14+
- APP 业务服务端需在超时时间内响应此请求。
15+
16+
## 可能触发该回调的场景
17+
- App 用户通过客户端请求修改群组资料。
18+
- App 管理员通过 REST API 变动群组资料。
19+
20+
## 回调发生时机
21+
- OpenIMServer 完成修改群组信息的操作后。
22+
23+
## 接口说明
24+
25+
### 请求 URL 示例
26+
以下示例中 App 配置的回调 URL 为 `http://www.example.com/callbackCommand?contenttype=json`
27+
```plaintext
28+
http://www.example.com/callbackAfterSetGroupInfoEXCommand?contenttype=json
29+
```
30+
31+
### 请求参数说明
32+
33+
| 参数 | 说明 |
34+
|-----------------|-----------------------------------------------|
35+
| http | 请求协议为 HTTP,请求方式为 POST |
36+
| www.example.com | configy.yaml 中的 callback.url 字段,域名或主机名 |
37+
| CallbackCommand | 此处为:callbackAfterSetGroupInfoEXCommand |
38+
| contenttype | 固定值为:JSON |
39+
40+
### Header
41+
| header名 | 示例值 | 选填 | 类型 | 说明 |
42+
|:------------|:--------------|:----|--------|---------------------|
43+
| operationID | 1646445464564 | 必填 | string | operationID用于全局链路追踪 |
44+
45+
### 请求包示例
46+
```json
47+
{
48+
"callbackCommand": "callbackAfterSetGroupInfoEXCommand",
49+
"groupInfoForSet": {
50+
"groupID": "G002",
51+
"groupName": "NewGroupName",
52+
"notification": "Updated group notification",
53+
"introduction": "Updated group introduction",
54+
"faceURL": "http://example.com/new/path/to/face/image.png",
55+
"ex": {
56+
"value": "Updated extra data"
57+
},
58+
"needVerification": {
59+
"value": 0
60+
},
61+
"lookMemberInfo": {
62+
"value": 1
63+
},
64+
"applyMemberFriend": {
65+
"value": 0
66+
}
67+
}
68+
}
69+
```
70+
71+
### 请求包字段说明
72+
73+
| 字段 | 类型 | 描述 |
74+
|----------------------|------------|-------------------------------------------|
75+
| callbackCommand | string | 回调命令,这里为设置群组信息之后的回调 |
76+
| groupInfoForSet | object | 包含已设置的群组信息的对象 |
77+
| groupID | string | 群组的唯一标识符 |
78+
| groupName | string | 群组的名称 |
79+
| notification | StringValue | 群组的通知信息 |
80+
| introduction | StringValue | 群组的简介 |
81+
| faceURL | StringValue | 群组的图标的URL |
82+
| ex | StringValue| 额外的数据字段 |
83+
| needVerification | Int32Value | 是否需要验证加入群组 |
84+
| lookMemberInfo | Int32Value | 是否可以查看群成员信息 |
85+
| applyMemberFriend | Int32Value | 是否可以申请加群成员为好友 |
86+
87+
## 应答包示例
88+
89+
### 操作完成
90+
确认群组信息修改操作已完成。
91+
92+
```json
93+
{
94+
"actionCode": 0,
95+
"errCode": 0,
96+
"errMsg": "Success",
97+
"errDlt": "",
98+
"nextCode": "nextCodeValue"
99+
}
100+
```
101+
102+
## 应答包
103+
104+
包字段说明
105+
106+
| 字段 || 说明 |
107+
|-------------|------------------------------|------------------------------------------|
108+
| actionCode | 0 | 表示业务系统的回调是否正确执行。`0`表示操作成功。 |
109+
| errCode | 0 | 表示自定义错误码,此处填0代表忽略回调结果。|
110+
| errMsg | "An error message" | 自定义错误码对应的简单错误信息。|
111+
| errDlt | "Detailed error information" | 自定义错误码对应的详细错误信息。|
112+
| nextCode | 1 | 下一步执行指令,`1`表示拒绝继续执行,actionCode等于`0`时设置。|
113+
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
title: 设置群组信息EX之前的回调
3+
hide_title: true
4+
---
5+
6+
# 设置群组信息EX之前的回调
7+
8+
## 功能说明
9+
App 业务服务端可以通过该回调在设置群组信息之前进行干预。这使得业务服务端可以在实际修改群组信息前,对请求进行审核或修改。
10+
11+
## 注意事项
12+
- 为启用回调,必须配置回调 URL,并开启本条回调协议对应的开关。配置方法详见 [回调说明](../introduction) 文档。
13+
- 回调的方向是 OpenIMServer 向 App 后台发起 HTTP/HTTPS POST 请求。
14+
- APP 业务服务端需在超时时间内响应此请求。
15+
16+
## 可能触发该回调的场景
17+
- App 用户通过客户端请求修改群组信息。
18+
- App 管理员通过 REST API 修改群组信息。
19+
20+
## 回调发生时机
21+
- OpenIMServer 收到设置群组信息的请求之后,处理该请求前。
22+
23+
## 接口说明
24+
25+
### 请求 URL 示例
26+
以下示例中 App 配置的回调 URL 为 `http://www.example.com/callbackCommand?contenttype=json`
27+
```plaintext
28+
http://www.example.com/callbackBeforeSetGroupInfoEXCommand?contenttype=json
29+
```
30+
31+
### 请求参数说明
32+
33+
| 参数 | 说明 |
34+
|-----------------|-----------------------------------------------|
35+
| http | 请求协议为 HTTP,请求方式为 POST |
36+
| www.example.com | configy.yaml 中的 callback.url 字段,域名或主机名 |
37+
| CallbackCommand | 此处为:callbackBeforeSetGroupInfoEXCommand |
38+
| contenttype | 固定值为:JSON |
39+
40+
### Header
41+
| header名 | 示例值 | 选填 | 类型 | 说明 |
42+
|:------------|:--------------|:----|--------|---------------------|
43+
| operationID | 1646445464564 | 必填 | string | operationID用于全局链路追踪 |
44+
45+
### 请求包示例
46+
```json
47+
{
48+
"callbackCommand": "callbackBeforeSetGroupInfoEXCommand",
49+
"groupInfoForSet": {
50+
"groupID": "G002",
51+
"groupName": "NewGroupName",
52+
"notification": "Updated group notification",
53+
"introduction": "Updated group introduction",
54+
"faceURL": "http://example.com/new/path/to/face/image.png",
55+
"ex": {
56+
"value": "Updated extra data"
57+
},
58+
"needVerification": {
59+
"value": 0
60+
},
61+
"lookMemberInfo": {
62+
"value": 1
63+
},
64+
"applyMemberFriend": {
65+
"value": 0
66+
}
67+
}
68+
}
69+
```
70+
71+
### 请求包字段说明
72+
73+
| 字段 | 类型 | 描述 |
74+
|----------------------|------------|-------------------------------------------|
75+
| callbackCommand | string | 回调命令,这里为设置群组信息之前的回调 |
76+
| groupInfoForSet | object | 包含要设置的群组信息的对象 |
77+
| groupID | string | 群组的唯一标识符 |
78+
| groupName | string | 群组的名称 |
79+
| notification | StringValue | 群组的通知信息 |
80+
| introduction | StringValue | 群组的简介 |
81+
| faceURL | StringValue | 群组的图标的URL |
82+
| ex | StringValue| 额外的数据字段 |
83+
| needVerification | Int32Value | 是否需要验证加入群组 |
84+
| lookMemberInfo | Int32Value | 是否可以查看群成员信息 |
85+
| applyMemberFriend | Int32Value | 是否可以申请加群成员为好友 |
86+
87+
## 应答包示例
88+
89+
### 允许修改
90+
允许修改群组信息。
91+
92+
```json
93+
{
94+
"actionCode": 0,
95+
"errCode": 0,
96+
"errMsg": "Success",
97+
"errDlt": "",
98+
"nextCode": "nextCodeValue",
99+
"groupInfoForSet": {
100+
"groupID": "G002",
101+
"groupName": "NewGroupName",
102+
"notification": "Updated group notification",
103+
"introduction": "Updated group introduction",
104+
"faceURL": "http://example.com/new/path/to/face/image.png",
105+
"ex": {
106+
"value": "Updated extra data"
107+
},
108+
"needVerification": {
109+
"value": 0
110+
},
111+
"lookMemberInfo": {
112+
"value": 1
113+
},
114+
"applyMemberFriend": {
115+
"value": 0
116+
}
117+
}
118+
}
119+
```
120+
121+
## 应答包字段说明
122+
123+
| 字段 | 类型 | 描述 |
124+
|---------------------|------------|-------------------------------------------|
125+
| actionCode | 0 | 表示业务系统的回调是否正确执行。`0`表示操作成功。 |
126+
| errCode | 5001 | 表示自定义错误码,范围在5000-9999之间。在 actionCode 不等于0时设置;在 nextCode 等于1时设置。|
127+
| errMsg | "An error message" | 自定义错误码对应的简单错误信息。|
128+
| errDlt | "Detailed error information" | 自定义错误码对应的详细错误信息。|
129+
| nextCode | 1 | 下一步执行指令,`1`表示拒绝继续执行,actionCode 等于`0`时设置。|
130+
| groupID | string | 群组的唯一标识符 |
131+
| groupName | string | 群组的名称 |
132+
| notification | StringValue | 群组的通知信息 |
133+
| introduction | StringValue | 群组的简介 |
134+
| faceURL | StringValue | 群组的图标的URL |
135+
| ex | StringValue| 额外的数据字段 |
136+
| needVerification | Int32Value | 是否需要验证加入群组 |
137+
| lookMemberInfo | Int32Value | 是否可以查看群成员信息 |
138+
| applyMemberFriend | Int32Value | 是否可以申请加群成员为好友 |
139+

0 commit comments

Comments
 (0)