服务交互流程

sequenceDiagram
    participant 前端
    participant SpringBoot
    participant 数据库
    participant Python服务
    participant COS
    
    前端->>SpringBoot: 点击播放按钮(costume_id)
    SpringBoot->>数据库: 查询voice_assets
    数据库-->>SpringBoot: 返回audio_url
    alt URL存在且有效:
        SpringBoot-->>前端: 返回音频URL
        前端->>COS: 直接播放音频
    else URL不存在或失效:
        SpringBoot->>Python服务: 发送生成任务(costume_id,text)
        Python服务->>Python服务: 生成语音文件
        Python服务->>COS: 上传音频文件
        Python服务->>数据库: 更新记录
        Python服务-->>SpringBoot: 回调通知完成
        SpringBoot-->>前端: 返回新音频URL
    end

项目分区导航:⬅️ 16-语音模块 | 17-服务交互流程 | ➡️ 18-稿子