txagent-y/docs/dev/admin-api/ADMIN-API-06-数据注水.md
远舟 8325d604ab docs(dev): 切换数据库为 PostgreSQL 并更新 4 周冲刺排期
- 重写数据库表设计文档为 PG schema(64 表,含分区/索引/触发器)
- API/Admin-API 全量术语替换:MongoDB→PostgreSQL,Collection→表,ObjectId→UUID
- 新增 API-11 系统配置接口
- 新增开发排期详细计划 v2.0(4 周冲刺,砍 IM/统计/客服等到 v1.1)
- 删除旧的后端排期/优先级/接口核查清单文档
2026-04-07 07:48:03 +08:00

5.8 KiB
Raw Blame History

ADMIN-API-06 数据注水BOOST

共 4 个接口BOOST-01~04

注水规则

  • boost 上限 = 真实数据的 3 倍
  • 发布 7 天后自动停止auto_stop_at
  • 真实数据超过 boost 值时自动停止
  • C端展示外显数据 = 真实数据 + boost 数据(仅 is_active=1 时叠加)

BOOST-01 设置内容注水

项目 说明
接口路径 POST /admin/api/v1/boost/contents
接口用途 对指定内容设置注水数据(浏览量/点赞/收藏)
权限要求 运营专员
涉及表 content_boost, post, admin_operation_log

接口逻辑:

  1. 校验管理员权限permission_key: boost:manage
  2. 查询 post 表,校验内容存在且 status=2已上架
  3. 校验注水值不超过真实数据的 3 倍
  4. 查询 content_boost 是否已有该 post_id 的记录(读)
    • 已有 → 更新注水值和 is_active=1更新
    • 没有 → 创建新记录,设置 auto_stop_at = post.published_at + 7天
  5. 设置 operated_by = 当前 admin_id更新
  6. 写入 admin_operation_logaction: set_content_boost

请求参数Body

字段 类型 必选 说明
postId string 内容ID
boostViewCount number 注水浏览量
boostLikeCount number 注水点赞数
boostFavoriteCount number 注水收藏数

响应数据:

字段 类型 说明
boostId string 注水配置ID
postId string 内容ID
boostViewCount number 注水浏览量
boostLikeCount number 注水点赞数
boostFavoriteCount number 注水收藏数
autoStopAt timestamp 自动停止时间

BOOST-02 关闭内容注水

项目 说明
接口路径 POST /admin/api/v1/boost/contents/:postId/close
接口用途 手动关闭某条内容的注水
权限要求 运营专员
涉及表 content_boost, admin_operation_log

接口逻辑:

  1. 校验管理员权限permission_key: boost:manage
  2. 查询 content_boostpost_id 匹配),校验 is_active=1
  3. 更新 is_active=0更新
  4. 写入 admin_operation_logaction: close_content_boost

说明: 关闭后该内容外显数据 = 仅真实数据。

路径参数:

字段 类型 必选 说明
postId string 内容ID

请求参数:

响应数据:

字段 类型 说明
postId string 内容ID
isActive boolean 注水状态false

BOOST-03 设置创作者注水

项目 说明
接口路径 POST /admin/api/v1/boost/creators
接口用途 对指定创作者的粉丝数/订阅数进行注水
权限要求 运营专员
涉及表 creator_boost, user, admin_operation_log

接口逻辑:

  1. 校验管理员权限permission_key: boost:manage
  2. 查询 user 表,校验用户存在且 role=2创作者
  3. 查询 creator_boost 是否已有该 creator_id 的记录(读)
    • 已有 → 更新注水值和 is_active=1更新
    • 没有 → 创建新记录(写)
  4. 设置 operated_by = 当前 admin_id更新
  5. 写入 admin_operation_logaction: set_creator_boost

请求参数Body

字段 类型 必选 说明
creatorId string 创作者ID
boostFollowerCount number 注水粉丝数
boostSubscriberCount number 注水订阅数

响应数据:

字段 类型 说明
boostId string 注水配置ID
creatorId string 创作者ID
boostFollowerCount number 注水粉丝数
boostSubscriberCount number 注水订阅数

BOOST-04 查看注水状态列表

项目 说明
接口路径 GET /admin/api/v1/boost/list
接口用途 查看当前所有注水的内容/创作者列表及其注水值
权限要求 运营专员
涉及表 content_boost, creator_boost, post, user

接口逻辑:

  1. 校验管理员权限permission_key: boost:manage
  2. 根据 type 参数筛选:
    • type=content → 查询 content_boostis_active=1关联 post 获取内容信息(读)
    • type=creator → 查询 creator_boostis_active=1关联 user 获取创作者信息(读)
    • type 不传 → 合并查询两者
  3. 支持分页

请求参数Query

字段 类型 必选 说明
type string 类型筛选content/creator不传为全部
page number 页码默认1
pageSize number 每页条数默认20

响应数据:

字段 类型 说明
list array 注水列表
list[].boostId string 注水配置ID
list[].type string 类型content/creator
list[].targetId string 目标ID
list[].targetName string 目标名称(内容标题/创作者昵称)
list[].boostValues object 注水值
list[].boostValues.viewCount number 注水浏览量content类型
list[].boostValues.likeCount number 注水点赞数content类型
list[].boostValues.favoriteCount number 注水收藏数content类型
list[].boostValues.followerCount number 注水粉丝数creator类型
list[].boostValues.subscriberCount number 注水订阅数creator类型
list[].autoStopAt timestamp 自动停止时间content类型
list[].operatedBy string 操作人
list[].createdAt timestamp 创建时间
pagination object 分页信息