PRINTFILM: AI short-video marketing and AI short-drama creation platform
授权函
增瑞 田1daaee6aedfc
diff --git a/backend/app/marketplace/authorization.py b/backend/app/marketplace/authorization.pyindex 107a90c..dab03dd 100644--- a/backend/app/marketplace/authorization.py+++ b/backend/app/marketplace/authorization.py@@ -101,7 +101,7 @@ def render_and_store(body: SignInput, signed_at: str, owner_id: int) -> str:fail("服务器未找到可用的中文字体,暂时无法生成授权函。", 503)except ImportError:logger.exception("授权函组件未安装")- fail("服务器未安装生成授权函所需组件,请安装 requirements-marketplace.txt 后重启。", 503)+ fail("后端依赖未更新,暂时无法生成授权函。请重新构建并发布后端后再试。", 503)except Exception:logger.exception("授权函生成失败")fail("授权函生成失败,请稍后重试。", 503)diff --git a/backend/requirements-marketplace.txt b/backend/requirements-marketplace.txtindex 27fe817..203d3ce 100644--- a/backend/requirements-marketplace.txt+++ b/backend/requirements-marketplace.txt@@ -1,4 +1,2 @@-# 下游授权函生成 PDF;原项目依赖文件保持独立。+# 市场额外说明。PDF 组件已列入 requirements.txt,常规后端镜像会一并安装。-r requirements.txt-Pillow==11.3.0-reportlab==4.4.4diff --git a/backend/requirements.txt b/backend/requirements.txtindex c0db982..7655011 100644--- a/backend/requirements.txt+++ b/backend/requirements.txt@@ -16,4 +16,7 @@ python-dotenv==1.1.0email-validator==2.2.0edge-tts==7.2.3oss2==2.19.1+# 授权函 PDF。reportlab 会一并使用 Pillow。+reportlab==4.4.4+Pillow==11.3.0# Optional: pip install "volcengine-python-sdk[ark]" if you prefer official SDKdiff --git a/backend/tests/test_marketplace.py b/backend/tests/test_marketplace.pyindex 34e6557..842231c 100644--- a/backend/tests/test_marketplace.py+++ b/backend/tests/test_marketplace.py@@ -438,7 +438,7 @@ def test_authorization_generation_error_is_not_storage(monkeypatch):with pytest.raises(HTTPException) as error:render_and_store(body, "2026-10-26T00:00:00+00:00", 1)assert error.value.status_code == 503- assert error.value.detail == "服务器未安装生成授权函所需组件,请安装 requirements-marketplace.txt 后重启。"+ assert error.value.detail == "后端依赖未更新,暂时无法生成授权函。请重新构建并发布后端后再试。"def test_letter_font_falls_back_when_configured_path_missing(monkeypatch):diff --git a/docs/MARKETPLACE.md b/docs/MARKETPLACE.mdindex 8ef98c4..8145839 100644--- a/docs/MARKETPLACE.md+++ b/docs/MARKETPLACE.md@@ -165,7 +165,7 @@ cd C:\code\printfilm\backend## 来源分流与上传预览补充(2026-10-20)- 授权签署入口:`/marketplace/authorization`,个人工作台与发布作品页均有入口,权属页内也可直接签署。-- 独立依赖安装:在 backend 目录执行 `.\.venv\Scripts\python.exe -m pip install -r requirements-marketplace.txt`。授权函直接生成 PDF,并把仓库内置的 Noto Sans SC 嵌进文件,服务器和下载方都不必另装字体。若 `MARKETPLACE_WATERMARK_FONT` 指向一个真实存在的文件,则仍优先使用该字体。水印预览使用同一套查找。+- 授权函 PDF 使用的 `reportlab` 已写入 `backend/requirements.txt`。按现有方式重新构建并发布后端镜像即可,不必再登录服务器单独安装。字体使用仓库内置的 Noto Sans SC,并嵌进 PDF。若 `MARKETPLACE_WATERMARK_FONT` 指向一个真实存在的文件,则仍优先使用该字体。- `marketplace_authorizations` 是新增独立表,启用模块启动时创建。签署存储全文、版本、SHA-256 摘要、姓名、时间、账号及必要访问信息;签名与完整授权函 PNG 存到私有 OSS 的 `marketplace/authorizations/`。全文与签名由服务端合成,不信任客户端合成的协议图片。未写入 OSS 不返回签署成功。- 授权函按账号与版本唯一,逐件权属档案只能由服务端关联本人的签署记录。重新保存材料会重置核验,模板更新须重签及重新关联。只有本人和管理员能获取短时授权函链接。- 协议采用数字资产市场当前范围:非独家展示、处理和客服撮合;没有自动转让、线上付款、分成或买家下载授权。ReelBay 仅参考流程,不复制它的支付或商业分成条款。