门户端接口【内部使用】6、我的作品
6.1 获取 发布 作品查询详情
POST
/api/user/assets/detail6.1 获取 发布 作品查询详情
作品发布详情接口
接口地址: POST /api/user/assets/detail
权限要求: 🔒 需要登录验证
请求头:
token: {token}描述: 根据作品ID查询作品详情,仅能查询当前用户自己的作品
请求参数:
{ "id": 1}| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| id | int | 是 | 作品ID |
请求示例:
curl -X POST "https://your-domain.com/api/user/assets/detail" \ -H "token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "id": 1 }'返回数据:
{ "code": 0, "success": true, "message": "", "data": { "id": 1, "user_id": 123, "cover_url": "https://example.com/cover.jpg", "resource_url": "https://example.com/resource.jpg", "work_at": 1234567890, "name": "我的作品", "creation_prompt": "", "category_id": 0, "classtag": "", "consume_quota": 50000, "consume_quota_usd": 0.1, "source_type": 0, "publish_status": 0, "published_at": 0, "fee_type": 1, "fee": 0, "view_count": 0, "like_count": 0, "use_count": 0, "total_earnings": 0, "created_at": 1234567890 }}错误返回:
{ "success": false, "message": "作品不存在或无权访问", "data": null}字段说明:
| 字段名 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码(0=成功) |
| success | bool | 是否成功 |
| message | string | 消息 |
| id | int | 作品ID |
| user_id | int | 用户ID |
| cover_url | string | 封面URL |
| resource_url | string | 资源URL |
| work_at | int64 | 作品时间戳 |
| name | string | 作品名称 |
| creation_prompt | string | 创作提示词 |
| category_id | int | 分类ID |
| classtag | string | 分类标签 |
| consume_quota | int | 消耗配额 |
| consume_quota_usd | float64 | 消耗配额(USD),通过 consume_quota / QuotaPerUnit 换算 |
| source_type | int | 来源类型 |
| publish_status | int | 发布状态(0=未发布,1=已发布) |
| published_at | int64 | 发布时间戳 |
| fee_type | int | 费用类型(1=免费,2=付费) |
| fee | int | 费用 |
| view_count | int | 浏览次数 |
| like_count | int | 点赞次数 |
| use_count | int | 使用次数 |
| total_earnings | int | 总收益 |
| created_at | int64 | 创建时间戳 |
注意事项:
- 只能获取当前用户自己的作品信息
- 如果作品不存在或已被删除,返回"作品不存在或无权访问"错误
- 如果作品不属于当前用户,返回"作品不存在或无权访问"错误