Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 121 additions & 1 deletion src/api/v1/group.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ title: group
<!-- @include: @src/full.proto#GroupData -->

// 机器人数据
<!-- @include: @src/full.proto#BotData -->
<!-- @include: @src/full.proto#BotData -->
```

:::
Expand Down Expand Up @@ -239,6 +239,7 @@ POST /v1/group/remove-member
"code":-1,
"msg":"您无权操作此群聊,请联系群主或者管理员"
}
```

@tab 无效用户 ID/不在群聊

Expand Down Expand Up @@ -998,3 +999,122 @@ POST /v1/group/switch
"msg": "success"
}
```

## 连接群聊 SSE

GET /v1/group/event-sse?groupId=`<groupId>`

请求头:

| 名称 | 必须 | 备注 |
| ----- | ---- | ---- |
| token | 是 | 无 |

响应头:

| 名称 | 内容 | 备注 |
| :------------------------------: | :----------------------------------------------------------------------------------------------------------------------: | :------------------------------: |
| Content-Type | text/event-stream | 无 |
| Cache-Control | no-cache | 无 |
| Transfer-Encoding | chunked | 无 |
| Access-Control-Allow-Credentials | true | 允许跨域请求携带凭证(如Cookie) |
| Access-Control-Allow-Headers | \* | 允许跨域请求携带所有自定义头 |
| Access-Control-Allow-Methods | POST, GET, OPTIONS | 允许跨域请求使用的HTTP方法 |
| Access-Control-Allow-Origin | \* | 允许所有域名跨域访问该资源 |
| Access-Control-Expose-Headers | Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Cache-Control, Content-Language, Content-Type | 允许前端JavaScript读取这些响应头 |

响应体:

::: tip 此处 data 部分换行只是为了备注方便,实际使用必须遵循 SSE 标准.
:::

```http
event: snapshot.shopEntry // 商城入口事件
data: {
"entryPosition":0 // 商城入口位置: 0-关, 1-功能面板, 2-悬浮
}

event: snapshot.llmParams
data: {"list":[]}

event: snapshot.liveRoom // 直播房间
data: {
"rooms": [
{
"userId": "7181558", // 发起者 ID
"roomId": "8f5eeb6a82a64e9bb397793966cbea93", // 房间 ID
"chatId": "979377289", // 所属会话 ID
"title": "", // 标题
"chatType": 2, // 会话类型
"status": 0, // 状态
"createBy": "7181558", // 创建者
"createTime": 1787824247, // 创建时间
"nickname": "足立零", // 昵称
"count": 1, // 人数
"avatarUrl": "https://chat-img.jwznb.com/6f14561ea45329e34bde805afb9e7373.jpg" // 发起人头像 URL
}
]
}
```

## 获取商城入口状态

请求头:

| 名称 | 必须 | 备注 |
| ----- | ---- | ---- |
| token | 是 | 无 |

请求体:

```json
{
"groupId": "118738312" // 群聊 ID
}
```

响应体:

```json
{
"code": 1,
"data": {
"entryPosition": 0 // 商城入口位置: 0-关, 1-功能面板, 2-悬浮
},
"msg": "success"
}
```

## 编辑商城入口状态

POST /v1/group/edit-shop-entry

请求头:

| 名称 | 必须 | 备注 |
| ----- | ---- | ---- |
| token | 是 | 无 |

请求体:

```json
{
"groupId": "118738312", // 群聊 ID
"entryPosition": 1 // 商城入口位置: 0-关, 1-功能面板, 2-悬浮
}
```

响应体:

::: tabs

@tab 未加入云湖伙伴计划

```json
{
"code": -1,
"msg": "您暂未加入云湖伙伴计划"
}
```

:::
48 changes: 44 additions & 4 deletions src/api/v1/misc.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ GET `https://api.qiniu.com/v4/query?ak=<access_key>&bucket=<bucket>`

:::

## 获取图片上传token
## 获取图片上传 token

GET /v1/misc/qiniu-token

Expand All @@ -79,7 +79,7 @@ GET /v1/misc/qiniu-token
}
```

## 获取音频上传token
## 获取音频上传 token

GET /v1/misc/qiniu-token-audio

Expand All @@ -101,7 +101,13 @@ GET /v1/misc/qiniu-token-audio
}
```

## 获取文件上传token
## 获取文件上传 token

::: tip

通过 ZIP 压缩文件导入表情包也是走这个接口上传文件的.需要手动指定 key 的前缀为 `stickerZip/114514.zip"` ~~当然不遵守也可以.不要问为什么这样我也不知道.~~

:::

GET /v1/misc/qiniu-token2

Expand Down Expand Up @@ -145,7 +151,7 @@ GET /v1/misc/qiniu-token-video
}
```

## 获取群文件上传token
## 获取群文件上传 token

GET /v1/misc/qiniu-token-group-disk

Expand All @@ -167,6 +173,40 @@ GET /v1/misc/qiniu-token-group-disk
}
```

## 获取表情上传 token

请求头:

| 名称 | 必须 | 备注 |
| ----- | ---- | ---- |
| token | 是 | 无 |

响应体:

```json
{
"code": 1,
"data": {
"token": "123:123" // 表情上传 token
},
"msg": "success"
}
```

::: info

七牛云返回的 key 永远带有 `sticker/` 前缀.

```json
{
"key":"sticker/abe73b4671e44aa984ab27ba3dda5951.png",
"hash":"FkSXEmuHphV9We5U1ChAFX7qxfLb",
"fsize":2063660
}
```

:::

## 获取云端设置

GET /v1/misc/setting
Expand Down
Loading