- FastAPI backend with build queue, WebSocket logs, task management - Vue 3 frontend with build/config/history views - Xcode project build automation with IPA export - Fix: initialize build_dir before try block to ensure cleanup on early failure
60 lines
1.2 KiB
Python
60 lines
1.2 KiB
Python
"""Pydantic 模型"""
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
from pydantic import BaseModel
|
|
|
|
|
|
# 打包任务
|
|
class TaskCreate(BaseModel):
|
|
app_id: str
|
|
build_type: str
|
|
scheme_id: str
|
|
obfuscation: bool = False
|
|
branch: str = "main"
|
|
|
|
|
|
class TaskResponse(BaseModel):
|
|
id: str
|
|
app_id: str
|
|
app_name: str
|
|
build_type: str
|
|
scheme_id: str
|
|
scheme_name: str
|
|
obfuscation: bool
|
|
branch: str
|
|
status: str
|
|
current_step: Optional[str]
|
|
created_at: Optional[datetime]
|
|
started_at: Optional[datetime]
|
|
completed_at: Optional[datetime]
|
|
ipa_path: Optional[str]
|
|
oss_url: Optional[str]
|
|
dsym_path: Optional[str]
|
|
obfuscation_maps_path: Optional[str]
|
|
qr_code_path: Optional[str]
|
|
build_dir: Optional[str]
|
|
error_message: Optional[str]
|
|
config_json: Optional[str]
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
# 登录
|
|
class LoginRequest(BaseModel):
|
|
username: str
|
|
password: str
|
|
|
|
|
|
class LoginResponse(BaseModel):
|
|
token: str
|
|
username: str
|
|
is_admin: bool
|
|
|
|
|
|
# 打包配置
|
|
class BuildConfigUpdate(BaseModel):
|
|
max_concurrent_builds: Optional[int] = None
|
|
build_dir_retention_hours: Optional[int] = None
|
|
build_base_dir: Optional[str] = None
|