fix: 修复 AI Code Review 阻塞级问题
CI/CD Pipeline / Check if frontend-only change (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / PR Build API Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Web Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
AI Code Review / AI Code Review (pull_request) Has been cancelled
PR Automation / Auto Approve on CI Green (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
Preview Deploy / Deploy Preview Environment (pull_request) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 910h22m33s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 910h22m37s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 910h22m39s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 910h22m43s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 910h22m42s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 910h56m1s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 910h56m8s
CI/CD Pipeline / Check if frontend-only change (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / PR Build API Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Web Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
AI Code Review / AI Code Review (pull_request) Has been cancelled
PR Automation / Auto Approve on CI Green (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
Preview Deploy / Deploy Preview Environment (pull_request) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 910h22m33s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 910h22m37s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 910h22m39s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 910h22m43s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 910h22m42s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 910h56m1s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 910h56m8s
- 迁移 seed 数据 ID 改用 UUID hex 格式,与领域模型一致 - 统一 InMemory 和 SQLAlchemy 排序逻辑(系统模板优先)
This commit is contained in:
@@ -22,14 +22,14 @@ branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
SYSTEM_TEMPLATES = [
|
||||
("sys_default", "默认模板", {}),
|
||||
("sys_bold_red", "大胆红", {"background_color": "#ef4444"}),
|
||||
("sys_elegant_black", "优雅黑", {"background_color": "#111827"}),
|
||||
("sys_gradient_blue", "渐变蓝", {"background_color": "#3b82f6"}),
|
||||
("sys_gradient_purple", "渐变紫", {"background_color": "#8b5cf6"}),
|
||||
("sys_warm_orange", "暖橙", {"background_color": "#f97316"}),
|
||||
("sys_fresh_green", "清新绿", {"background_color": "#22c55e"}),
|
||||
("sys_tech_blue", "科技蓝", {"background_color": "#06b6d4"}),
|
||||
("a8b0120fd98e44788f5a6590f983d327", "默认模板", {}),
|
||||
("6d8c501b11424432b3df3a45ae89b1a9", "大胆红", {"background_color": "#ef4444"}),
|
||||
("04937fb57fea4bad95e7883e71a6b246", "优雅黑", {"background_color": "#111827"}),
|
||||
("3ff9cc821174437ca53931073e7f536e", "渐变蓝", {"background_color": "#3b82f6"}),
|
||||
("db51b3ea8f1a4f4caa94bf2d51f27d11", "渐变紫", {"background_color": "#8b5cf6"}),
|
||||
("5027d113432a4f798a3b4ee1644d66af", "暖橙", {"background_color": "#f97316"}),
|
||||
("0e10def2b5a148d686416494474726c2", "清新绿", {"background_color": "#22c55e"}),
|
||||
("38ea98ac00c04bada064006d880546f0", "科技蓝", {"background_color": "#06b6d4"}),
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 智能剪辑页面 — 常量定义
|
||||
*/
|
||||
|
||||
import type { CoverConfig, CoverTemplate } from "../editing-planner/types"
|
||||
import type { CoverConfig } from "../editing-planner/types"
|
||||
|
||||
/* ── 克隆声音状态配置 ── */
|
||||
export const CLONE_STATUS_CONFIG: Record<string, { label: string; color: string }> = {
|
||||
@@ -199,39 +199,3 @@ export const DEFAULT_COVER_SETTINGS: CoverConfig = {
|
||||
thumbnail_url: "",
|
||||
}
|
||||
|
||||
/* ── Mock 封面模板数据 ── */
|
||||
|
||||
export const MOCK_COVER_TEMPLATES: CoverTemplate[] = [
|
||||
{ id: "default", name: "默认模板", thumbnail_url: "", is_system: true, created_at: "2026-08-01" },
|
||||
{ id: "bold-red", name: "大胆红", thumbnail_url: "", is_system: true, created_at: "2026-08-01" },
|
||||
{
|
||||
id: "elegant-black",
|
||||
name: "优雅黑",
|
||||
thumbnail_url: "",
|
||||
is_system: true,
|
||||
created_at: "2026-08-01",
|
||||
},
|
||||
{
|
||||
id: "gradient-blue",
|
||||
name: "渐变蓝",
|
||||
thumbnail_url: "",
|
||||
is_system: true,
|
||||
created_at: "2026-08-01",
|
||||
},
|
||||
{
|
||||
id: "gradient-purple",
|
||||
name: "渐变紫",
|
||||
thumbnail_url: "",
|
||||
is_system: true,
|
||||
created_at: "2026-08-01",
|
||||
},
|
||||
{ id: "warm-orange", name: "暖橙", thumbnail_url: "", is_system: true, created_at: "2026-08-01" },
|
||||
{
|
||||
id: "fresh-green",
|
||||
name: "清新绿",
|
||||
thumbnail_url: "",
|
||||
is_system: true,
|
||||
created_at: "2026-08-01",
|
||||
},
|
||||
{ id: "tech-blue", name: "科技蓝", thumbnail_url: "", is_system: true, created_at: "2026-08-01" },
|
||||
]
|
||||
|
||||
@@ -19,7 +19,7 @@ class InMemoryCoverTemplateRepository:
|
||||
def list_for_user(self, user_id: str, skip: int = 0, limit: int = 100) -> list[CoverTemplate]:
|
||||
"""列出系统模板 + 用户自己的模板。"""
|
||||
visible = [t for t in self._templates.values() if t.is_system or t.user_id == user_id]
|
||||
visible.sort(key=lambda t: (not t.is_system, t.created_at), reverse=True)
|
||||
visible.sort(key=lambda t: (t.is_system, t.created_at), reverse=True)
|
||||
return visible[skip : skip + limit]
|
||||
|
||||
def count_for_user(self, user_id: str) -> int:
|
||||
|
||||
@@ -170,7 +170,7 @@ class TestCoverTemplateAPIPermissions:
|
||||
mock_repo.get.return_value = tpl
|
||||
|
||||
# 模拟 API 路由中的权限检查逻辑
|
||||
template = mock_repo.get("sys_default")
|
||||
template = mock_repo.get("a8b0120fd98e44788f5a6590f983d327")
|
||||
assert template is not None
|
||||
assert template.is_system is True
|
||||
# 权限检查应该阻止删除
|
||||
@@ -184,7 +184,7 @@ class TestCoverTemplateAPIPermissions:
|
||||
mock_repo = MagicMock()
|
||||
mock_repo.get.return_value = tpl
|
||||
|
||||
template = mock_repo.get("sys_default")
|
||||
template = mock_repo.get("a8b0120fd98e44788f5a6590f983d327")
|
||||
assert template.is_system is True
|
||||
with pytest.raises(PermissionError):
|
||||
if template.is_system:
|
||||
|
||||
Reference in New Issue
Block a user