mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 23:17:20 +08:00
refactor(api): standardize responses and restore media config contracts
This commit is contained in:
@@ -1,11 +1,38 @@
|
||||
from fastapi import Query
|
||||
from pydantic import BaseModel
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from app.schemas.common import JsonData
|
||||
|
||||
|
||||
class CookieData(BaseModel):
|
||||
encrypted: str = Query(min_length=1, max_length=1024 * 1024 * 50)
|
||||
uuid: str = Query(min_length=5, pattern="^[a-zA-Z0-9]+$")
|
||||
"""CookieCloud 上传的加密数据。"""
|
||||
|
||||
encrypted: str = Field(min_length=1, max_length=1024 * 1024 * 50)
|
||||
uuid: str = Field(min_length=5, pattern="^[a-zA-Z0-9]+$")
|
||||
|
||||
|
||||
class CookiePassword(BaseModel):
|
||||
"""CookieCloud 下载并解密数据所需的密码。"""
|
||||
|
||||
password: str
|
||||
|
||||
|
||||
class CookieActionResponse(BaseModel):
|
||||
"""CookieCloud 上传操作结果。"""
|
||||
|
||||
action: Literal["done", "error"]
|
||||
|
||||
|
||||
class CookieEncryptedPayload(BaseModel):
|
||||
"""CookieCloud 保存和下载的加密载荷。"""
|
||||
|
||||
encrypted: str
|
||||
|
||||
|
||||
class CookieDecryptedPayload(BaseModel):
|
||||
"""CookieCloud 解密后的 Cookie 数据载荷。"""
|
||||
|
||||
model_config = ConfigDict(extra="allow")
|
||||
|
||||
cookie_data: JsonData
|
||||
|
||||
Reference in New Issue
Block a user