This commit is contained in:
macbook_max
2026-10-15 20:36:59 +08:00
commit 6bf949949c
7923 changed files with 1369582 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
"""视频模块请求模型(对应《03-接口文档》第 5 章)"""
from pydantic import BaseModel, Field
class WatchReq(BaseModel):
position: int = Field(default=0, ge=0, description="当前播放进度(秒)")
class WatchCompleteReq(BaseModel):
watch_duration: int = Field(ge=0, description="本次实际观看时长(秒)")
class UploadTokenReq(BaseModel):
"""5.5 获取上传凭证"""
file_name: str = Field(min_length=1, max_length=200)
file_size: int = Field(gt=0, description="字节数")
upload_mode: str = Field(default="raw", pattern="^(raw|hls)$")
class PublishVideoReq(BaseModel):
"""5.6 发布视频(开发环境仅支持 raw 模式:object_key 必填)"""
object_key: str = Field(min_length=1, max_length=300)
title: str = Field(min_length=1, max_length=100)
description: str = Field(default="", max_length=500)
category_id: int = Field(ge=1)
tags: list[str] = Field(default_factory=list, max_length=5)
class EditVideoReq(BaseModel):
"""5.12 编辑视频(字段均可选,传哪个改哪个)"""
title: str | None = Field(default=None, min_length=1, max_length=100)
description: str | None = Field(default=None, max_length=500)
category_id: int | None = Field(default=None, ge=1)
tags: list[str] | None = Field(default=None, max_length=5)