knowledge-invite-flow.md 3.3 KB

用户使用流程图 — 健康知识库与邀请

flowchart TD
    %% ============ 颜色定义 ============
    classDef actor fill:#e1f5fe,stroke:#0288d1,stroke-width:2px
    classDef action fill:#fff3e0,stroke:#f57c00,stroke-width:1px
    classDef system fill:#e8f5e9,stroke:#388e3c,stroke-width:1px
    classDef decision fill:#fce4ec,stroke:#d32f2f,stroke-width:1px
    classDef role fill:#f3e5f5,stroke:#7b1fa2,stroke-width:1px
    classDef endpoint fill:#f5f5f5,stroke:#616161,stroke-width:1px

    subgraph 健康知识库
        A1(("管理员")) --> A2[查询知识库 /query]
        A2 --> A3[批量查询 /batch-query]
        A3 --> A4[列表查询 /list]
        A4 --> A5[新增条目 /add]
        A5 --> A6[更新条目 /update]
        A6 --> A7[删除条目 /delete]
        A7 --> A8[从JSON导入 /import]
    end

    subgraph KB v3查询
        A8 --> B1[查询菌属功能 /v3/bacteria/query]
        B1 --> B2[批量查询菌属 /v3/bacteria/batch-query]
        B2 --> B3[查询指标调整 /v3/indicator/query]
        B3 --> B4[查询食物营养 /v3/food/query]
        B4 --> B5[获取原始数据 /v3/section]
    end

    subgraph 邀请码管理
        C1(("用户")) --> C2[生成邀请码 /invite/code]
        C2 --> C3[绑定邀请 /invite/bind]
        C3 --> C4[获取邀请列表 /invite/list]
        C4 --> C5[获取邀请汇总 /invite/summary]
        C5 --> C6[获取邀请二维码 /invite/qrcode]
    end

    subgraph 邀请卡片
        C6 --> D1[生成邀请码 /invite-card/generate]
        D1 --> D2[验证邀请码 /invite-card/verify]
        D2 --> D3[接受邀请 /invite-card/accept]
    end

    subgraph 邀请里程碑
        D3 --> E1[获取里程碑列表 /invite/milestone/list]
        E1 --> E2[领取里程碑奖励 /invite/milestone/claim]
    end

    subgraph 入门引导
        C1 --> F1[获取引导进度 /onboarding/progress]
        F1 --> F2[领取奖励 /onboarding/claim]
    end

    R1(("🔧 管理员")):::actor
    R2(("👤 用户")):::role

    A1 -.- R1
    C1 -.- R2

端点明细

端点 说明
/api/health/knowledge/query 查询知识库
/api/health/knowledge/batch-query 批量查询
/api/health/knowledge/list 列表查询
/api/health/knowledge/add 新增条目
/api/health/knowledge/update 更新条目
/api/health/knowledge/delete 删除条目
/api/health/knowledge/import 导入数据
/api/health/knowledge/v3/bacteria/query 菌属功能查询
/api/health/knowledge/v3/bacteria/batch-query 批量菌属查询
/api/health/knowledge/v3/indicator/query 指标调整建议
/api/health/knowledge/v3/food/query 食物营养数据
/api/health/knowledge/v3/section 原始数据
/api/invite/code 生成邀请码
/api/invite/bind 绑定邀请
/api/invite/list 邀请列表
/api/invite/summary 邀请汇总
/api/invite/qrcode 邀请二维码
/api/invite-card/generate 生成邀请卡片
/api/invite-card/verify 验证邀请码
/api/invite-card/accept 接受邀请
/api/invite/milestone/list 里程碑列表
/api/invite/milestone/claim 领取奖励
/api/onboarding/progress 引导进度
/api/onboarding/claim 领取奖励