docs(content): 合并 short_video/long_video 为统一 video 类型

This commit is contained in:
远舟 2026-04-08 13:56:47 +08:00
parent da44f0c3e9
commit 0deeb170af
5 changed files with 19 additions and 21 deletions

View File

@ -12,13 +12,12 @@
## 内容类型枚举
> 与 [API-04 内容系统](../api/API-04-内容系统.md) 对齐:仅 3 类。
> 与 [API-04 内容系统](../api/API-04-内容系统.md) 对齐:仅 2 类。
| DB值 | API值 | 说明 |
|------|------|------|
| 1 | post | 动态图文1-9 张图)|
| 2 | short_video | 短视频(≤ 60s|
| 3 | long_video | 长视频(> 60s|
| 2 | video | 视频(不区分时长)|
## 状态枚举
@ -86,7 +85,7 @@
| list[].title | string | 标题 |
| list[].contentPreview | string | 正文截断(前 100 字)|
| list[].coverUrl | url | 封面图URL |
| list[].type | string | 类型post/short_video/long_video |
| list[].type | string | 类型post/video |
| list[].visibility | string | 可见性档位 |
| list[].status | string | 状态draft/reviewing/published/rejected/removed |
| list[].publishedAt | timestamp | 发布时间(已上架才有) |

View File

@ -7,8 +7,7 @@
| DB值 | API值 | 说明 |
|------|------|------|
| 1 | post | 动态图文1-9 张图)|
| 2 | short_video | 短视频(≤ 60s|
| 3 | long_video | 长视频(> 60s|
| 2 | video | 视频(不区分时长)|
> PPV 素材**不在此枚举**,独立走 API-06 PPV 系统(数据模型完全不同)。发布页 UI 上"发布 PPV 素材"按钮直接跳转到 PPV 创建流程。
@ -60,7 +59,7 @@
2. 校验 mediaIds查询 `media` 表 确认 process_status=2 且 user_id=当前用户
3. 校验 tags1-3 个):每项 `id``name` 二选一。传 `id``tag` 表存在性校验;只传 `name` 时若同名 tag 已存在则复用,否则当场创建 source=2 的自定义标签(等价于内联 CONTENT-12
4. 校验 mentions查询 `user` 表 确认被 @ 用户存在
5. 若 type IN (2,3) 且包含 highlights校验 time_offset_seconds < 视频时长
5. 若 type=2video且包含 highlights校验 time_offset_seconds < 视频时长
6. 校验 visibility若不是 `free`,查询 `subscription_tier` 表 WHERE creator_id=当前用户 AND tier_level=映射值 AND is_active=true不存在则返回 422"该档位未启用"
7. 写入 `post`status=isDraft?0:1写入 location_name/codevisibility 存映射后的 int 值)
8. 写入关系表post_media / post_tag / post_mention / post_highlight
@ -73,7 +72,7 @@
|------|------|------|------|
| title | string | 否 | 标题,最长 30 字 |
| content | string | 否 | 正文内容,最长 200 字 |
| type | string | 是 | 内容类型post/short_video/long_video |
| type | string | 是 | 内容类型post/video |
| mediaIds | int64[] | 否 | 媒体ID数组图片最多9张或1个视频 |
| tags | object[] | 是 | 标签数组1-3 个;每项 `id``name` 二选一 |
| tags[].id | string | 否 | 已存在的标签 ID系统预设或已建好的自定义标签 |
@ -83,7 +82,7 @@
| location.name | string | 否 | 地点显示名(如"上海 静安区"),最长 64 字 |
| location.code | string | 否 | 行政区划代码GB/T 2260最长 20 字 |
| visibility | string | 是 | 可见性:`free` 或当前创作者已启用的档位 keyjunior/basic/senior/supreme 之一)。后端会校验该 key 对应的 tier_level 在当前创作者的 `subscription_tier` 中存在且 `is_active=true`,否则返回 422 |
| highlights | array | 否 | 视频章节标记数组type=short_video/long_video 时),用于在播放进度条上打点跳转 |
| highlights | array | 否 | 视频章节标记数组type=video 时),用于在播放进度条上打点跳转 |
| highlights[].timeOffsetSeconds | int | 是 | 标记时间点(秒),必须 < 视频时长 |
| highlights[].label | string | 否 | 标记说明文字(最长 40 字) |
| isDraft | boolean | 否 | 是否保存为草稿,默认 false |
@ -159,8 +158,8 @@
| list[].title | string | 标题 |
| list[].coverUrl | url | 封面图URL |
| list[].blurCoverUrl | url | 模糊封面URL |
| list[].type | string | 类型post/short_video/long_video |
| list[].duration | number | 视频时长。type 为 short_video/long_video 时返回,非视频或无媒体时省略 |
| list[].type | string | 类型post/video |
| list[].duration | number | 视频时长。type 为 video 时返回,非视频或无媒体时省略 |
| list[].visibility | string | 可见性档位 keyfree/junior/basic/senior/supreme |
| list[].visibilityTierName | string | 该档位在当前创作者下的展示名free 时为 null |
| list[].visibilityTierPrice | number | 该档位价格free 时省略 |
@ -243,7 +242,7 @@
| creator | object | 创作者信息 |
| title | string | 标题 |
| content | string | 正文无权限时截断前2行 |
| type | string | 内容类型 post/short_video/long_video |
| type | string | 内容类型 post/video |
| images | array | 图片列表 |
| images[].mediaId | string | 媒体ID |
| images[].url | url | 原图签名URL有权限时 |

View File

@ -121,7 +121,7 @@
1. 查询 `post` 表 WHERE creator_id=creatorId AND status=2已上架
2. 按 `tab` 参数过滤:
- `posts`(默认):返回全部类型内容
- `media`:仅返回 `type IN (short_video, long_video)` 或含图片媒体的 post
- `media`:仅返回 `type = video` 或含图片媒体的 post
- `private`:仅返回 `visibility >= 1`(付费档内容)
3. 关联查询 `media` 表 获取封面图(读)
4. 查询 `content_boost` 表 获取注水数据(读)
@ -150,7 +150,7 @@
| list[].title | string | 标题 |
| list[].coverUrl | url | 封面图 |
| list[].blurCoverUrl | url | 模糊封面(锁定态展示) |
| list[].type | string | post/short_video/long_video |
| list[].type | string | post/video |
| list[].visibility | string | 可见性档位 keyfree/junior/basic/senior/supreme |
| list[].visibilityTierName | string/null | 该档位在当前创作者下的展示名 |
| list[].isLocked | boolean | 是否需要订阅才能查看锁定态展示「订阅查看全文」CTA |

View File

@ -55,7 +55,7 @@
| posts.list | array | 帖子列表,字段与 CONTENT-02 列表项一致 |
| posts.list[].postId | string | 帖子 ID |
| posts.list[].title | string | 标题 |
| posts.list[].type | string | `post / short_video / long_video` |
| posts.list[].type | string | `post / video` |
| posts.list[].coverUrl | url | 封面图 |
| posts.list[].blurCoverUrl | url | 模糊封面(锁定态使用) |
| posts.list[].duration | number | 时长(秒,视频类) |
@ -241,7 +241,7 @@
| list[].postId | string | 帖子ID |
| list[].title | string | 帖子标题 |
| list[].coverUrl | url | 封面图URL |
| list[].type | string | 内容类型post/short_video/long_video |
| list[].type | string | 内容类型post/video |
| list[].creator | object | 创作者信息 |
| list[].creator.userId | string | 创作者ID |
| list[].creator.nickname | string | 昵称 |

View File

@ -430,7 +430,7 @@ CREATE INDEX idx_post_search ON post USING GIN (search_vector);
COMMENT ON COLUMN post.title IS '标题,最长 30 字';
COMMENT ON COLUMN post.content IS '正文,最长 200 字';
COMMENT ON COLUMN post.type IS '1=动态(图文) 2=短视频 3=长视频 4=笔记 5=投票PPV 不在此枚举,走 ppv_material 表)';
COMMENT ON COLUMN post.type IS '1=动态(图文) 2=视频 4=笔记 5=投票PPV 不在此枚举,走 ppv_material 表)';
COMMENT ON COLUMN post.visibility IS '0=免费公开 1=初级会员 2=基础会员 3=高级会员 4=至尊会员';
COMMENT ON COLUMN post.status IS '0=草稿 1=审核中 2=已上架 3=拒绝 4=已下架';
COMMENT ON COLUMN post.location_name IS '地点显示名(如"上海 静安区"';
@ -562,7 +562,7 @@ CREATE INDEX idx_post_mention_user ON post_mention (mentioned_user);
### 5.8 post_highlight视频撸点/兴奋点标记)
> 仅 `post.type IN (2,3)`(短视频/长视频)才可写入。前端在播放进度条上展示标记点。
> 仅 `post.type = 2`视频)才可写入。前端在播放进度条上展示标记点。
```sql
CREATE TABLE post_highlight (
@ -577,11 +577,11 @@ CREATE TABLE post_highlight (
CREATE INDEX idx_post_highlight_post ON post_highlight (post_id, time_offset_seconds);
-- 仅允许在视频类型type=2/3)的 post 上写入撸点
-- 仅允许在视频类型type=2的 post 上写入撸点
CREATE OR REPLACE FUNCTION trg_check_post_highlight_type() RETURNS TRIGGER AS $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM post WHERE id = NEW.post_id AND type IN (2,3)) THEN
RAISE EXCEPTION 'post_highlight only allowed on post.type IN (2,3)';
IF NOT EXISTS (SELECT 1 FROM post WHERE id = NEW.post_id AND type = 2) THEN
RAISE EXCEPTION 'post_highlight only allowed on post.type = 2';
END IF;
RETURN NEW;
END $$ LANGUAGE plpgsql;