From ebe5babccd0ca8bd76776f4b8ae21c921d706d49 Mon Sep 17 00:00:00 2001 From: Audit Bot Date: Sat, 27 Jun 2026 17:04:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(#23,#24):=20=E7=BB=9F=E4=B8=80=20storage=5F?= =?UTF-8?q?key/file=5Furl=20=E5=91=BD=E5=90=8D=E5=92=8C=20file=5Fsize=20?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AssetModel: 添加 storage_key 字段注释说明为 OSS 对象键 - AssetModel/GeneratedVideoModel: file_size 从 Float 改为 Integer - 添加 file_url 字段注释说明为完整可访问 URL - 确保字节数精度,避免浮点数精度问题 --- packages/adapters/sqlalchemy_impl/models.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/adapters/sqlalchemy_impl/models.py b/packages/adapters/sqlalchemy_impl/models.py index 129ee9b06..c317558db 100755 --- a/packages/adapters/sqlalchemy_impl/models.py +++ b/packages/adapters/sqlalchemy_impl/models.py @@ -63,7 +63,11 @@ class AssetModel(Base): asset_library_id = Column(String(36), nullable=False, index=True) name = Column(String(500), nullable=False) file_type = Column(String(20), nullable=False, index=True) - file_size = Column(Float, nullable=False) + # storage_key: OSS 对象键(相对路径),用于内部存储和操作 + storage_key = Column(String(255), nullable=False) + # file_size: 文件大小(字节),使用 Integer 类型以确保精确性 + file_size = Column(Integer, nullable=False) + # file_url: 完整可访问的 URL,用于客户端直接访问文件 file_url = Column(String(1000), nullable=False) thumbnail_url = Column(String(1000), nullable=True) duration = Column(Float, nullable=True) @@ -194,8 +198,10 @@ class GeneratedVideoModel(Base): project_id = Column(String(32), nullable=False, index=True) generation_task_id = Column(String(32), nullable=False, index=True) name = Column(String(255), nullable=False) + # file_url: 完整可访问的 URL,用于客户端直接访问视频 file_url = Column(String(1000), nullable=False) - file_size = Column(Float, nullable=False) + # file_size: 文件大小(字节),使用 Integer 类型以确保精确性 + file_size = Column(Integer, nullable=False) duration = Column(Float, nullable=False) thumbnail_url = Column(String(1000), nullable=True) width = Column(Float, nullable=False)