用户相册
请求URL:
/userAlbum
请求方式:
- POST
header:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| Authorization | 是 | string | 授权token |
参数:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| appId | 是 | string | App唯一标识 |
| udid | 是 | string | 唯一设备ID |
| type | 否 | uint8 | 兼容旧客户端的单类型参数:0-全部;1-聊天生图;2-聊天生视频;8-主动生图;9-主动生视频,默认0 |
| types | 否 | uint8[] | 多类型筛选,例如 [8,9]、[1,2]、[1,8];传入后优先于 type |
| page | 否 | uint | 页码,从1开始,默认1 |
| pageSize | 否 | uint | 每页数量,默认20,最大100 |
多类型请求示例:
{
"appId": "com.example.app",
"udid": "device-uuid",
"types": [8, 9],
"page": 1,
"pageSize": 20
}
返回示例
{
"code": 200,
"msg": "SUCCESS",
"data": {
"images": [
{
"id": 1001,
"pid": 0,
"recordId": 29621,
"dialogueId": 4971,
"roleId": 10003,
"type": 8,
"state": 30,
"path": "https://muyuhan.s3.amazonaws.com/aiChat/media/original/image.jpg",
"thumbURL": "https://muyuhan.s3.amazonaws.com/aiChat/media/thumb/image.jpg",
"reason": "",
"startTime": 1763104933,
"elapsedTime": 12,
"updatedAt": 1763104945
}
],
"videos": [
{
"id": 1002,
"pid": 0,
"recordId": 29622,
"dialogueId": 4971,
"roleId": 10003,
"type": 9,
"state": 30,
"path": "https://muyuhan.s3.amazonaws.com/aiChat/media/original/video.mp4",
"thumbURL": "",
"reason": "",
"startTime": 1763105000,
"elapsedTime": 35,
"updatedAt": 1763105035
}
],
"total": 2,
"page": 1,
"pageSize": 20
}
}
返回参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码 |
| msg | string | 提示信息 |
| data | struct | 数据 |
| - images | array | 图片列表 |
| - videos | array | 视频列表 |
| - total | int64 | 总数量 |
| - page | uint | 当前页码 |
| - pageSize | uint | 每页数量 |
| -- id | uint | 生图/生视频任务ID |
| -- pid | uint | 父任务ID |
| -- recordId | uint | 对话记录ID |
| -- dialogueId | uint | 会话ID |
| -- roleId | uint | 角色ID |
| -- type | uint8 | 任务类型:1-聊天生图;2-聊天生视频;8-主动生图;9-主动生视频 |
| -- state | uint8 | 任务状态,用户相册固定只返回30-执行完成 |
| -- path | string | 图片或视频地址 |
| -- thumbURL | string | 缩略图地址,图片类型返回;视频类型为空 |
| -- reason | string | 任务说明;相册任务通常为空 |
| -- startTime | int64 | 开始生成时间 |
| -- elapsedTime | uint | 生成耗时,单位秒 |
| -- updatedAt | int64 | 更新时间 |
备注
- 无论使用
type还是types,接口只返回状态30且文件地址不为空的任务;状态2、10、20不会出现在用户相册中。 types支持同时筛选任意多个任务类型并自动去重;允许的值为1、2、8、9。数组中包含0时按全部类型查询。- 未传
types时继续使用旧的type参数;传入types后以types为准。无数据时code仍为200,msg为Have No Data。
错误码: 510 系统异常 800 参数错误