52ff2f80ad
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Build Production Runtime Images (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
Deploy / Production Browser E2E (push) Has been cancelled
37 lines
973 B
Python
37 lines
973 B
Python
"""Recipe domain entities."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass, field
|
|
from datetime import datetime, timezone
|
|
from typing import List
|
|
|
|
|
|
@dataclass
|
|
class RecipeItem:
|
|
"""配方中的单个素材/标题/配音项"""
|
|
|
|
id: str
|
|
recipe_id: str
|
|
item_type: str # asset / title / voice
|
|
item_id: str
|
|
position: int = 0
|
|
metadata_: dict = field(default_factory=dict)
|
|
|
|
|
|
@dataclass
|
|
class Recipe:
|
|
"""配方 — 一次「一键生成」的完整参数组合"""
|
|
|
|
id: str
|
|
user_id: str
|
|
name: str
|
|
description: str = ""
|
|
template_id: str = ""
|
|
generation_params: dict = field(default_factory=dict)
|
|
items: List[RecipeItem] = field(default_factory=list)
|
|
is_active: bool = True
|
|
metadata_: dict = field(default_factory=dict)
|
|
created_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
|
|
updated_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
|