txagent-y/docs/dev/api/README.md

12 KiB
Raw Blame History

API 接口文档目录(按模块拆分)

版本: v2.1
基于文档: API-接口设计文档-技术视角.md
拆分日期: 2026-03-31
接口总数: 107 个


模块索引

# 模块 接口数 文件
01 用户系统 17 AUTH-01~08 + USER-01~09
02 媒体处理 4 MEDIA-01~04
03 代币支付 11 COIN-01~09 + IAP-01~02
04 内容系统 19 CONTENT-01~17 + CONTENT-07A含02b/02cFeed 支持分类模板与 random 排序)
05 订阅系统 8 SUB-01~08
06 PPV系统 16 PPV-01~12 + PPV-04A + PPV-05A + PPV-10A~10B群发初始化含后台可配置引导文案群发链路改为异步批次轮询 + IM batch 投递)
07 消息系统 7 MSG-01~07
08 创作者系统 11 CREATOR-01~11
09 提现系统 7 WD-01~07
10 搜索通知举报 12 SEARCH-01~04 + NOTI-01~03 + REPORT-01~02 + HISTORY-01~02 + FEEDBACK-01 + ERRORLOG-01
11 系统配置 3 CONFIG-01~03
12 IM联调 1 IM-01

接口总览

01 用户系统17个

  • AUTH-01 账号密码注册 — POST /client/api/v1/auth/register
  • AUTH-02 账号密码登录 — POST /client/api/v1/auth/login
  • AUTH-03 苹果登录 — POST /client/api/v1/auth/apple
  • AUTH-04 谷歌登录 — POST /client/api/v1/auth/google
  • AUTH-05 Token 刷新 — POST /client/api/v1/auth/refresh
  • AUTH-06 退出登录 — POST /client/api/v1/auth/logout
  • AUTH-07 游客登录 — POST /client/api/v1/auth/guest
  • AUTH-08 游客升级为正式账号 — POST /client/api/v1/auth/upgrade
  • USER-01 获取当前用户信息 — GET /client/api/v1/users/me
  • USER-02 修改个人资料 — PUT /client/api/v1/users/me
  • USER-03 获取通知设置 — GET /client/api/v1/users/me/notification-setting
  • USER-04 更新通知设置 — PUT /client/api/v1/users/me/notification-setting
  • USER-05 获取隐私设置 — GET /client/api/v1/users/me/privacy-setting
  • USER-06 更新隐私设置 — PUT /client/api/v1/users/me/privacy-setting
  • USER-07 获取第三方绑定状态 — GET /client/api/v1/users/me/oauth-bindings
  • USER-08 修改密码 — PUT /client/api/v1/users/me/password
  • USER-09 注销账号 — DELETE /client/api/v1/users/me

02 媒体处理4个

  • MEDIA-01 上传图片 — POST /client/api/v1/media/image
  • MEDIA-02 上传视频 — POST /client/api/v1/media/video
  • MEDIA-03 获取签名URL — GET /client/api/v1/media/:mediaId/signed-url
  • MEDIA-04 查询媒体处理状态 — GET /client/api/v1/media/:mediaId/status

03 代币支付11个

  • COIN-01 获取钱包信息 — GET /client/api/v1/coin/wallet
  • COIN-02 获取充值档位列表 — GET /client/api/v1/coin/recharge-tiers
  • COIN-03 创建充值订单 — POST /client/api/v1/coin/recharge
  • COIN-04 支付回调stub / 非 PayCenter 通道)— POST /client/api/v1/coin/recharge/callback
  • COIN-05 查询充值订单状态 — GET /client/api/v1/coin/recharge/:orderId
  • COIN-06 查询交易流水 — GET /client/api/v1/coin/transactions
  • COIN-07 每日签到 — POST /client/api/v1/coin/checkin
  • COIN-08 获取签到状态 — GET /client/api/v1/coin/checkin/status
  • COIN-09 PayCenter 支付回调admin 服务承接)— POST /admin/api/v1/third/paycenter/recharge/callback
  • IAP-01 验证苹果购买凭证 — POST /client/api/v1/iap/verify
  • IAP-02 获取苹果商品列表 — GET /client/api/v1/iap/products

04 内容系统19个

  • CONTENT-01 发布内容 — POST /client/api/v1/content
  • CONTENT-02 获取广场 Feed支持分类模板与 random 排序)— GET /client/api/v1/content/feed
  • CONTENT-02b 获取关注 Feed支持分类模板与 random 排序)— GET /client/api/v1/content/feed/following
  • CONTENT-02c 获取视频播放流 — GET /client/api/v1/content/video-feed
  • CONTENT-03 获取内容详情 — GET /client/api/v1/content/:contentId
  • CONTENT-03A 解锁 PPV 内容 — POST /client/api/v1/content/:contentId/unlock
  • CONTENT-04 获取发布页推荐/搜索标签列表 — GET /client/api/v1/content/tags
  • CONTENT-05 内容管理列表(创作者) — GET /client/api/v1/content/manage
  • CONTENT-06 编辑内容 — PUT /client/api/v1/content/:contentId
  • CONTENT-07 删除/下架内容 — DELETE /client/api/v1/content/:contentId
  • CONTENT-08 点赞/取消点赞 — POST /client/api/v1/content/:contentId/like
  • CONTENT-09 收藏/取消收藏 — POST /client/api/v1/content/:contentId/favorite
  • CONTENT-10 获取收藏列表 — GET /client/api/v1/content/favorites
  • CONTENT-10A 批量取消收藏 — DELETE /client/api/v1/content/favorites
  • CONTENT-11 获取首页分类列表 — GET /client/api/v1/content/categories
  • CONTENT-12 创建自定义标签 — POST /client/api/v1/content/tags/custom
  • CONTENT-13 获取帖子评论列表 — GET /client/api/v1/content/:contentId/comments
  • CONTENT-14 获取评论回复列表 — GET /client/api/v1/content/comments/:commentId/replies
  • CONTENT-15 发表评论 — POST /client/api/v1/content/:contentId/comments
  • CONTENT-16 删除评论 — DELETE /client/api/v1/content/comments/:commentId
  • CONTENT-17 评论点赞/取消点赞 — POST /client/api/v1/content/comments/:commentId/like

05 订阅系统8个

  • SUB-01 获取创作者订阅档位 — GET /client/api/v1/subscription/tiers/:creatorId
  • SUB-02 购买订阅 — POST /client/api/v1/subscription/purchase
  • SUB-03 升级订阅 — POST /client/api/v1/subscription/:subscriptionId/upgrade
  • SUB-04 降级订阅 — POST /client/api/v1/subscription/:subscriptionId/downgrade
  • SUB-05 手动续费 — POST /client/api/v1/subscription/:subscriptionId/renew
  • SUB-06 查询我的订阅列表 — GET /client/api/v1/subscription/mine
  • SUB-07 设置订阅档位(创作者) — PUT /client/api/v1/subscription/tiers/settings
  • SUB-08 取消订阅 — POST /client/api/v1/subscription/:subscriptionId/cancel

06 PPV系统14个

  • PPV-01 上传PPV素材 — POST /client/api/v1/ppv/material
  • PPV-02 获取PPV素材库 — GET /client/api/v1/ppv/materials
  • PPV-03 发送PPV消息 — POST /client/api/v1/ppv/send
  • PPV-04 发送PPV消息回执绑定 — POST /client/api/v1/ppv/send/bind
  • PPV-04A 群发PPV页面初始化 — GET /client/api/v1/ppv/broadcast/bootstrap
  • PPV-05 群发PPV — POST /client/api/v1/ppv/broadcast
  • PPV-05A 查询群发批次状态 — GET /client/api/v1/ppv/broadcast/batches/:batchId
  • PPV-06 批量查询PPV状态 — POST /client/api/v1/ppv/status/batch
  • PPV-07 解锁PPV — POST /client/api/v1/ppv/:ppvMessageId/unlock
  • PPV-08 按素材ID直接解锁PPV — POST /client/api/v1/ppv/material/:materialId/unlock
  • PPV-09 获取已解锁PPV签名URL — GET /client/api/v1/ppv/:ppvMessageId/signed-url
  • PPV-10 删除PPV素材 — DELETE /client/api/v1/ppv/material/:materialId
  • PPV-11 获取已购买内容列表 — GET /client/api/v1/ppv/purchased
  • PPV-12 获取已购买素材签名URL — GET /client/api/v1/ppv/material/:materialId/signed-url

07 消息系统7个

  • MSG-01 获取会话列表 — GET /client/api/v1/message/conversations
  • MSG-02 获取聊天记录 — GET /client/api/v1/message/conversations/:conversationId/messages
  • MSG-03 发送消息 — POST /client/api/v1/message/send
  • MSG-04 拉黑用户 — POST /client/api/v1/message/block
  • MSG-05 取消拉黑 — POST /client/api/v1/message/unblock
  • MSG-06 获取黑名单列表 — GET /client/api/v1/message/block/list
  • MSG-07 获取在线状态 — GET /client/api/v1/message/online-status/:userId

08 创作者系统14个

  • CREATOR-01 申请成为创作者 — POST /client/api/v1/creator/apply
  • CREATOR-02 获取创作者主页 — GET /client/api/v1/creator/:creatorId
  • CREATOR-03 获取创作者内容列表 — GET /client/api/v1/creator/:creatorId/contents
  • CREATOR-04 关注创作者 — POST /client/api/v1/creator/:creatorId/follow
  • CREATOR-05 取消关注 — DELETE /client/api/v1/creator/:creatorId/follow
  • CREATOR-06 获取关注列表 — GET /client/api/v1/creator/following
  • CREATOR-07 获取粉丝列表(创作者) — GET /client/api/v1/creator/fans
  • CREATOR-08 修改创作者资料 — PATCH /client/api/v1/creator/profile
  • CREATOR-09 停止创作者身份 — POST /client/api/v1/creator/deactivate
  • CREATOR-10 创作者数据总览 — GET /client/api/v1/creator/dashboard
  • CREATOR-10A 获取推广短链信息 — GET /client/api/v1/creator/promotion
  • CREATOR-10B 获取推广引流统计 — GET /client/api/v1/creator/promotion/stats
  • CREATOR-10C 推广短链入口(公开) — GET /:username
  • CREATOR-11 搜索粉丝(@ 选择器) — GET /client/api/v1/creator/fans/search
  • CREATOR-12 移除粉丝 — DELETE /client/api/v1/creator/fans/:fanId

09 提现系统6个

  • WD-01 获取收款方式列表 — GET /client/api/v1/withdrawal/accounts
  • WD-02 绑定收款方式 — POST /client/api/v1/withdrawal/accounts
  • WD-03 申请提现 — POST /client/api/v1/withdrawal/apply
  • WD-03A 提现试算 — POST /client/api/v1/withdrawal/quote
  • WD-04 查询提现记录 — GET /client/api/v1/withdrawal/records
  • WD-05 修改收款方式 — PATCH /client/api/v1/withdrawal/accounts/:accountId
  • WD-06 解绑收款方式 — DELETE /client/api/v1/withdrawal/accounts/:accountId

10 搜索通知举报10个

  • SEARCH-01 综合搜索 — GET /client/api/v1/search
  • SEARCH-02 获取热门搜索词 — GET /client/api/v1/search/trending
  • 注:搜索历史由客户端本地存储,后端不提供 SEARCH-03/04
  • NOTI-01 获取通知列表 — GET /client/api/v1/notification/list
  • NOTI-02 标记已读 — PUT /client/api/v1/notification/read
  • NOTI-03 获取未读数 — GET /client/api/v1/notification/unread-count
  • REPORT-01 举报内容 — POST /client/api/v1/report/content
  • REPORT-02 举报IM消息 — POST /client/api/v1/report/message
  • HISTORY-01 获取浏览历史 — GET /client/api/v1/history/views
  • HISTORY-02 清除浏览历史 — DELETE /client/api/v1/history/views
  • FEEDBACK-01 提交帮助与反馈 — POST /client/api/v1/feedback
  • ERRORLOG-01 上报客户端异常日志 — POST /client/api/v1/uploadlogs

11 系统配置3个

  • CONFIG-01 获取全局配置 — GET /client/api/v1/config
  • CONFIG-02 获取可用域名列表 — GET /client/api/v1/config/domains
  • CONFIG-03 获取城市列表 — GET /client/api/v1/config/cities

12 IM联调3个

  • IM-01 获取 IM 登录凭证 — POST /client/api/v1/im/token
  • IM-02 搜索聊天对象候选人 — GET /client/api/v1/im/users/search
  • IM-03 按业务用户ID查询 IM 用户ID — GET /client/api/v1/im/users/:userId

通用约定

  • Base URL https://api.txfans.com/v1
  • 数据格式: JSONContent-Type: application/json
  • 认证方式: Bearer TokenAuthorization: Bearer <token>
  • 分页参数: page页码默认1pageSize每页条数默认20最大50
  • API字段风格 camelCase | DB字段风格 snake_case
  • 统一响应: { "code": 0, "message": "success", "data": {} }

统一错误码

code 说明
0 成功
400 参数错误
401 未认证/Token过期
403 无权限
404 资源不存在
409 资源冲突/重复操作
422 业务逻辑错误
429 请求频率限制
500 服务器内部错误