Files
小鱼开发 fc4ebb7de0 feat: 封面背景图迁移到数据库,按script_code分类获取
后端:
- 新建 mjk_cover_backgrounds 表(Alembic e02c96e264d9)
- CoverBackground模型/CRUD/Schema/API(GET /cover-backgrounds?script_code=)

前端:
- ScriptCreation保存categoryCode到store和meta.json
- CoverDesign从API获取背景图,替换bg-config.json
- 修复useEffect不响应categoryCode变化的bug

其他:
- 删除Rust遗留的generate_cover_image命令和burn_ass_subtitle_to_image函数
2026-05-13 11:07:11 +08:00

53 lines
1.3 KiB
Python

"""
封面背景图模型
================
按脚本大类(script_code)分组存储封面背景图。
示例:
- script_code="bk"(装修避坑)→ 该大类下的所有封面背景图
"""
from sqlalchemy import BigInteger, String
from sqlalchemy.orm import Mapped, mapped_column
from app.models.base import BaseModelBigInt
class CoverBackground(BaseModelBigInt):
"""封面背景图"""
__tablename__ = "mjk_cover_backgrounds"
script_code: Mapped[str] = mapped_column(
String(64),
nullable=False,
comment="关联脚本大类 code,如 bk(装修避坑)",
)
title: Mapped[str] = mapped_column(
String(256),
nullable=False,
comment="背景图名称,运营识别用",
)
url: Mapped[str] = mapped_column(
String(1024),
nullable=False,
comment="七牛云 CDN 图片地址",
)
sort_order: Mapped[int] = mapped_column(
BigInteger,
default=0,
nullable=False,
comment="排序权重,数字越小越靠前",
)
status: Mapped[str] = mapped_column(
String(16),
default="active",
nullable=False,
comment="状态:active(启用)/ disabled(停用)/ deleted(软删除)",
)