f7c8b441d6
Deploy / Build Production Runtime Images (push) Has been skipped
Deploy / Deploy Production (push) Has been skipped
Deploy / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 173h2m54s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 173h2m59s
Deploy / Deploy Staging (push) Failing after 173h22m24s
CI/CD Pipeline / Frontend Lint (push) Failing after 173h22m54s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 173h23m2s
Task 3.01: CosyVoice 配置 - 在 SharedSettings 中添加 CosyVoice 配置字段 - 更新 .env.example 和 .env.production.example Task 3.02: VoiceCloneProfile 领域模型 - 创建 VoiceCloneProfile 实体(音色克隆档案) - 状态机: pending → processing → ready/failed → disabled - 支持重试机制(retry_count/max_retries) - 创建 VoiceCloneProfileRepository 端口接口 Task 3.03: TTSJob 领域模型 - 创建 TTSJob 实体(TTS 任务) - 关联 VoiceCloneProfile(voice_clone_profile_id) - 状态机: pending → processing → completed/failed → cancelled - 支持重试机制 - 创建 TTSJobRepository 端口接口 单元测试: - VoiceCloneProfile: 31 个测试用例 - TTSJob: 34 个测试用例 - 全部 65 个测试通过 遵循六边形架构: Domain → Port → Adapter
52 lines
1.4 KiB
Python
52 lines
1.4 KiB
Python
"""VoiceCloneProfileRepository 端口接口 — Phase 3 CosyVoice 集成."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Protocol
|
|
|
|
from packages.domain.voice_clone_profile import VoiceCloneProfile, VoiceCloneStatus
|
|
|
|
|
|
class VoiceCloneProfileRepository(Protocol):
|
|
"""音色克隆档案仓储接口。"""
|
|
|
|
def create(self, profile: VoiceCloneProfile) -> VoiceCloneProfile:
|
|
"""持久化一个新音色克隆档案。"""
|
|
...
|
|
|
|
def get(self, profile_id: str) -> VoiceCloneProfile | None:
|
|
"""根据 ID 获取档案。"""
|
|
...
|
|
|
|
def update(self, profile: VoiceCloneProfile) -> VoiceCloneProfile:
|
|
"""更新档案状态。"""
|
|
...
|
|
|
|
def delete(self, profile_id: str) -> bool:
|
|
"""删除档案。"""
|
|
...
|
|
|
|
def list_by_user(
|
|
self,
|
|
user_id: str,
|
|
*,
|
|
status: VoiceCloneStatus | str | None = None,
|
|
limit: int = 50,
|
|
offset: int = 0,
|
|
) -> list[VoiceCloneProfile]:
|
|
"""按用户列出档案,支持状态过滤。"""
|
|
...
|
|
|
|
def count_by_user(
|
|
self,
|
|
user_id: str,
|
|
*,
|
|
status: VoiceCloneStatus | str | None = None,
|
|
) -> int:
|
|
"""按用户统计档案数量。"""
|
|
...
|
|
|
|
def find_by_voice_id(self, voice_id: str) -> VoiceCloneProfile | None:
|
|
"""根据 CosyVoice 返回的音色 ID 查找档案。"""
|
|
...
|