Token model for Flow2API
| 6 | |
| 7 | |
| 8 | class Token(BaseModel): |
| 9 | """Token model for Flow2API""" |
| 10 | |
| 11 | id: Optional[int] = None |
| 12 | |
| 13 | # 认证信息 (核心) |
| 14 | st: str # Session Token (__Secure-next-auth.session-token) |
| 15 | at: Optional[str] = None # Access Token (从ST转换而来) |
| 16 | at_expires: Optional[datetime] = None # AT过期时间 |
| 17 | |
| 18 | # 基础信息 |
| 19 | email: str |
| 20 | name: Optional[str] = "" |
| 21 | remark: Optional[str] = None |
| 22 | is_active: bool = True |
| 23 | created_at: Optional[datetime] = None |
| 24 | last_used_at: Optional[datetime] = None |
| 25 | use_count: int = 0 |
| 26 | |
| 27 | # VideoFX特有字段 |
| 28 | credits: int = 0 # 剩余credits |
| 29 | user_paygate_tier: Optional[str] = None # PAYGATE_TIER_ONE |
| 30 | |
| 31 | # 项目管理 |
| 32 | current_project_id: Optional[str] = None # 当前使用的项目UUID |
| 33 | current_project_name: Optional[str] = None # 项目名称 |
| 34 | |
| 35 | # 功能开关 |
| 36 | image_enabled: bool = True |
| 37 | video_enabled: bool = True |
| 38 | |
| 39 | # 并发限制 |
| 40 | image_concurrency: int = -1 # -1表示无限制 |
| 41 | video_concurrency: int = -1 # -1表示无限制 |
| 42 | |
| 43 | # 打码代理(token 级,可覆盖全局浏览器打码代理) |
| 44 | captcha_proxy_url: Optional[str] = None |
| 45 | extension_route_key: Optional[str] = None |
| 46 | |
| 47 | # 协议刷新 Session Token |
| 48 | protocol_mode: str = "session" # session/protocol |
| 49 | google_cookies: str = "" |
| 50 | login_account: str = "" |
| 51 | login_password: str = "" |
| 52 | proxy_url: str = "" |
| 53 | auto_refresh_enabled: bool = True |
| 54 | refresh_interval_minutes: int = 120 |
| 55 | last_st_refresh_at: Optional[datetime] = None |
| 56 | last_st_refresh_result: str = "" |
| 57 | |
| 58 | # 429禁用相关 |
| 59 | ban_reason: Optional[str] = None # 禁用原因: "429_rate_limit" 或 None |
| 60 | banned_at: Optional[datetime] = None # 禁用时间 |
| 61 | |
| 62 | |
| 63 | class Project(BaseModel): |
no outgoing calls