门户端接口【内部使用】11.APPS应用
11.2 APPS他人作品列表
POST
/api/apps/other-works11.2 APPS他人作品列表
APPS他人作品列表
接口地址: POST /api/apps/other-works
权限要求: 🔒 需要登录验证
请求头:
token: {token}描述: 查询指定APP的他人作品列表,支持分页查询,按创建时间降序排列
请求参数:
{ "source_app_id": 1, "page": 1, "page_size": 20}| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| source_app_id | int | 是 | APP ID |
| page | int | 否 | 页码,从1开始,默认为1 |
| page_size | int | 否 | 每页条数,默认为20,最大为100 |
请求示例:
curl -X POST "https://your-domain.com/api/apps/other-works" \ -H "token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "source_app_id": 1, "page": 1, "page_size": 20 }'返回数据:
{ "code": 0, "success": true, "message": "success", "data": { "total": 100, "page": 1, "page_size": 20, "items": [ { "id": 1, "task_id": "task_123", "user_id": 123, "work_type": 2, "save_method": 1, "cover_url": "https://example.com/cover.jpg", "resource_url": "https://example.com/resource.jpg", "work_at": 1234567890, "name": "作品名称", "text": "", "creation_prompt": "", "classtag": "标签1,标签2", "consume_quota": 50000, "category_id": 0, "source_type": 2, "source_app_id": 1, "source_id": 100, "publish_status": 1, "published_at": 1234567890, "is_public": 1, "fee_type": 1, "fee": 0, "view_count": 10, "like_count": 5, "collect_count": 2, "use_count": 3, "heat_value": 20, "recommended_value": 10, "total_earnings": 0, "deleted": 0, "created_at": 1234567890, "updated_at": 1234567890 } ] }}错误返回:
{ "code": 400, "success": false, "message": "参数错误: Key: 'ListAppsOtherWorksRequest.SourceAppId' Error:Field validation for 'SourceAppId' failed on the 'required' tag", "data": null}{ "code": -1, "success": false, "message": "数据库错误", "data": null}字段说明:
| 字段名 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码(0=成功,400=参数错误,-1=系统错误) |
| success | bool | 是否成功 |
| message | string | 消息 |
| data.total | int64 | 总记录数 |
| data.page | int | 当前页码 |
| data.page_size | int | 每页条数 |
| data.items | array | 作品列表 |
| items[].id | int | 作品ID |
| items[].task_id | string | 任务ID |
| items[].user_id | int | 用户ID |
| items[].work_type | int | 作品类型(1=文本,2=图片,3=视频,4=音频) |
| items[].save_method | int | 保存方式(1=AI创作,2=手动上传) |
| items[].cover_url | string | 封面URL |
| items[].resource_url | string | 资源URL |
| items[].work_at | int64 | 作品时间戳 |
| items[].name | string | 作品名称 |
| items[].text | string | 文本内容 |
| items[].creation_prompt | string | 创作提示词 |
| items[].classtag | string | 分类标签 |
| items[].consume_quota | int | 消耗配额 |
| items[].category_id | int | 分类ID |
| items[].source_type | int | 来源类型(0=无,1=常规,2=应用) |
| items[].source_app_id | int | 来源APP ID |
| items[].source_id | int | 来源ID |
| items[].publish_status | int | 发布状态(0=未发布,1=已发布) |
| items[].published_at | int64 | 发布时间戳 |
| items[].is_public | int | 是否公开(0=不公开,1=公开) |
| items[].fee_type | int | 费用类型(1=免费,2=付费) |
| items[].fee | int | 费用 |
| items[].view_count | int | 浏览次数 |
| items[].like_count | int | 点赞次数 |
| items[].collect_count | int | 收藏次数 |
| items[].use_count | int | 使用次数 |
| items[].heat_value | int | 热度值 |
| items[].recommended_value | int | 推荐值 |
| items[].total_earnings | int | 总收益 |
| items[].deleted | int | 删除状态(0=正常,1=已删除) |
| items[].created_at | int64 | 创建时间戳 |
| items[].updated_at | int64 | 更新时间戳 |
注意事项:
- 需要登录验证,token通过请求头传递
- 查询条件:deleted = 0、is_public = 1、publish_status = 1、source_type = 2、source_app_id = 请求参数
- 按创建时间降序排列
- 支持分页查询,默认每页20条,最大100条
- 查询已优化,使用索引确保查询效率