wish-management-flow.md 3.4 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
    classDef portMiniApp fill:#e3f2fd,stroke:#1565c0,stroke-width:1px,stroke-dasharray:3 2
    classDef portAdmin fill:#fce4ec,stroke:#c62828,stroke-width:1px,stroke-dasharray:3 2
    classDef portGuide fill:#fff8e1,stroke:#f57f17,stroke-width:1px,stroke-dasharray:3 2
    classDef portSystem fill:#f3e5f5,stroke:#6a1b9a,stroke-width:1px,stroke-dasharray:3 2

    subgraph 心愿创建
        A1(("👶 孩子")):::portMiniApp --> A2[📱 创建心愿 /create]:::portMiniApp
        A2 --> A3{📱 家长审批}:::portMiniApp
        A3 -->|通过| A4[📱 家长定价 /:id/set-price]:::portMiniApp
        A3 -->|拒绝| A5[📱 家长拒绝 /:id/reject]:::portMiniApp
        A4 --> A6[📱 心愿上架 显示积分价格]:::portMiniApp
        A5 --> A7[📱 心愿关闭]:::portMiniApp
    end

    subgraph 心愿兑换
        A6 --> B1[📱 孩子申请兑换 /:id/exchange]:::portMiniApp
        B1 --> B2[⚙️ 系统检查积分余额]:::portSystem
        B2 --> B3{⚙️ 积分充足?}:::portSystem
        B3 -->|是| B4[📱 家长审批兑换 /:id/approve-exchange]:::portMiniApp
        B3 -->|否| B5[📱 积分不足 提示赚积分]:::portMiniApp
        B4 --> B6{📱 家长审批}:::portMiniApp
        B6 -->|通过| B7[📱 家长标记已购买 /:id/fulfill]:::portMiniApp
        B6 -->|拒绝| B8[📱 兑换驳回]:::portMiniApp
    end

    subgraph 收货完成
        B7 --> C1[📱 家长购买商品]:::portMiniApp
        C1 --> C2[📱 孩子确认收货 /:id/confirm]:::portMiniApp
        C2 --> C3[⚙️ 心愿完成 扣除积分]:::portSystem
    end

    subgraph 查询管理
        A6 --> D1[📱 获取心愿列表 /list]:::portMiniApp
        D1 --> D2[📱 获取待处理列表 /pending]:::portMiniApp
        D2 --> D3[📱 获取心愿详情 /:id]:::portMiniApp
        A7 --> D3
        C3 --> D1
        D3 --> E1[📱 取消心愿 /:id/cancel]:::portMiniApp
    end

    R1(("👶 孩子")):::actor
    R2(("👤 家长")):::role
    R3(("💎 积分系统")):::system

    A1 -.- R1
    A3 -.- R2
    B3 -.- R3

端点明细

端点 说明 端口
/api/wishes/create 创建心愿 📱小程序
/api/wishes/{id}/set-price 家长定价 📱小程序
/api/wishes/{id}/reject 家长拒绝心愿 📱小程序
/api/wishes/{id}/exchange 孩子申请兑换 📱小程序
/api/wishes/{id}/approve-exchange 家长审批兑换 📱小程序
/api/wishes/{id}/fulfill 家长标记已购买 📱小程序
/api/wishes/{id}/confirm 孩子确认收货 📱小程序
/api/wishes/{id}/cancel 取消心愿 📱小程序
/api/wishes/list 获取心愿列表 📱小程序
/api/wishes/pending 获取待处理列表 📱小程序
/api/wishes/{id} 获取心愿详情 📱小程序