ai-marketing-docs/业务调用逻辑.md

6.6 KiB
Raw Permalink Blame History

业务需求的服务调用逻辑(详细版)

基于 5 服务架构:gateway-bff / orchestration-service / agent-center / content-center / delivery-connector-douyin


总体时序图(示例:内容生成与发布)

sequenceDiagram
  participant U as 用户/前端
  participant G as gateway-bff
  participant O as orchestration-service
  participant A as agent-center
  participant C as content-center
  participant D as delivery-connector-douyin

  U->>G: 提交内容生成请求
  G->>O: 转发并鉴权
  O->>A: 生成标题/文案/脚本
  A-->>O: 返回生成结果
  O->>C: 保存草稿/成品
  C-->>O: 返回内容ID
  O-->>G: 返回结果
  G-->>U: 展示生成内容

  U->>G: 发起发布请求
  G->>O: 转发发布指令
  O->>D: 发布到抖音
  D-->>C: 回写发布状态
  D-->>O: 发布结果
  O-->>G: 返回发布结果
  G-->>U: 展示发布状态

1. 爆款标题生成器P0

目标

生成标题并保存为草稿,供运营二次编辑。

调用流程

  1. 前端提交主题与约束 → gateway-bff
  2. gateway-bff 鉴权后转发 → orchestration-service
  3. orchestration-service 组装上下文 → 调用 agent-center
  4. agent-center 根据模板生成标题
  5. 结果回到 orchestration-service
  6. orchestration-service 将标题写入 content-center(状态=草稿)
  7. 返回前端

输出

  • 草稿内容 ID
  • 标题候选列表

2. 多平台文案生成P0

目标

基于不同平台规范生成文案。

调用流程

  1. 前端选择平台与主题 → gateway-bff
  2. gateway-bfforchestration-service
  3. orchestration-service 调用 agent-center(带平台模板参数)
  4. agent-center 输出平台适配文案
  5. orchestration-service 保存到 content-center(草稿)
  6. 返回前端

3. AI 图文创作P0

目标

生成图文内容并入库。

调用流程

  1. 前端提交主题 → gateway-bff
  2. gateway-bfforchestration-service
  3. orchestration-serviceagent-center 生成文案/描述
  4. 如有外部生图服务 → orchestration-service 调用生成图片
  5. orchestration-servicecontent-center 保存图文成品
  6. 返回前端

4. 视频脚本生成P0

目标

生成结构化脚本,便于后续制作。

调用流程

  1. 前端提交脚本类型 → gateway-bff
  2. gateway-bfforchestration-service
  3. orchestration-serviceagent-center
  4. agent-center 输出脚本结构(分镜/台词)
  5. orchestration-servicecontent-center 保存脚本
  6. 返回前端

5. 智能发布P1

目标

将内容发布到抖音并记录状态。

调用流程

  1. 前端选择内容并发布 → gateway-bff
  2. gateway-bfforchestration-service
  3. orchestration-service 拉取内容详情 → content-center
  4. orchestration-servicedelivery-connector-douyin 发起发布
  5. delivery-connector-douyin 回写发布状态 → content-center
  6. 返回前端

6. 内容日历排期P1

目标

按排期定时发布内容。

调用流程

  1. 前端创建排期 → gateway-bff
  2. gateway-bfforchestration-service(内嵌调度)
  3. 到达时间点 → orchestration-service 调用 delivery-connector-douyin
  4. 发布状态回写 → content-center

7. 多账号管理P1

目标

完成抖音账号授权与可用性管理。

调用流程

  1. 前端绑定账号 → gateway-bff
  2. gateway-bffdelivery-connector-douyin
  3. delivery-connector-douyin 完成 OAuth 授权
  4. 账号素材信息 → content-center 存储

8. 数据监控看板P1

目标

展示投放效果指标。

调用流程

  1. delivery-connector-douyin 定时拉取数据
  2. orchestration-service 汇总并生成聚合指标
  3. 前端访问 → gateway-bfforchestration-service

9. 爆款内容复刻P0

目标

发现爆款后自动复刻生成。

调用流程

  1. delivery-connector-douyin 发现爆款 → 事件入队
  2. orchestration-service 消费事件并判断规则
  3. orchestration-serviceagent-center 触发复刻 Workflow
  4. 复刻内容写入 content-center
  5. 返回通知/状态

10. 智能客服P1

目标

自动回复客户消息。

调用流程

  1. 渠道消息进入 → gateway-bff
  2. gateway-bfforchestration-service
  3. orchestration-service 判断会话状态(自动/人工)
  4. 自动模式下 → agent-center 生成回复
  5. orchestration-service 发送回复(通过渠道或 H5

11. 话术推荐引擎P1

目标

为客服提供推荐话术。

调用流程

  1. 客服请求推荐 → gateway-bff
  2. gateway-bfforchestration-service
  3. orchestration-serviceagent-center 生成话术
  4. 返回推荐话术

12. 客户意向评分P1

目标

基于行为给出意向等级。

调用流程

  1. 行为事件进入 → orchestration-service(轻量 CDP
  2. 评分计算与更新
  3. 对外提供查询接口

13. 自动留资引导P1

目标

自动引导客户留资。

调用流程

  1. orchestration-service 触发引导
  2. agent-center 生成引导话术
  3. 通过渠道发送

14. 人工接管P1

目标

从机器人切换到人工。

调用流程

  1. 客服发起接管 → gateway-bff
  2. gateway-bfforchestration-service
  3. orchestration-service 更新会话状态
  4. 通知 agent-center 停止自动回复

15. 客户旅程设计器P1

目标

配置客户旅程流程。

调用流程

  1. 前端配置 → gateway-bff
  2. gateway-bfforchestration-service
  3. orchestration-service 持久化旅程定义

16. 自动跟进任务P1

目标

根据旅程状态自动创建跟进任务。

调用流程

  1. 旅程触发 → orchestration-service
  2. 创建跟进任务并通知

17. 成交素材库P2

目标

为成交流程提供素材。

调用流程

  1. 素材管理 → gateway-bff
  2. gateway-bffcontent-center
  3. orchestration-service 按权限调用

18. 数据复盘看板P0

目标

综合展示内容与投放效果。

调用流程

  1. orchestration-service 汇总投放/内容/行为数据
  2. 前端查询 → gateway-bfforchestration-service

统一交互原则

  • 入口统一通过 gateway-bff
  • 业务流程统一在 orchestration-service
  • 智能决策统一在 agent-center
  • 内容与素材统一在 content-center
  • 渠道接入统一在 delivery-connector-douyin