- 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
51 lines
1.4 KiB
Python
51 lines
1.4 KiB
Python
"""数据库模型"""
|
|
from datetime import datetime
|
|
from sqlalchemy import Column, String, Boolean, Text, TIMESTAMP
|
|
from .database import Base
|
|
|
|
|
|
class Task(Base):
|
|
"""打包任务表"""
|
|
__tablename__ = "tasks"
|
|
|
|
id = Column(String, primary_key=True)
|
|
app_id = Column(String, nullable=False)
|
|
app_name = Column(String, nullable=False)
|
|
build_type = Column(String, nullable=False)
|
|
scheme_id = Column(String, nullable=False)
|
|
scheme_name = Column(String, nullable=False)
|
|
obfuscation = Column(Boolean, default=False)
|
|
branch = Column(String, default="main")
|
|
|
|
# 状态
|
|
status = Column(String, default="pending") # pending/running/completed/failed/cancelled
|
|
current_step = Column(String)
|
|
|
|
# 时间
|
|
created_at = Column(TIMESTAMP, default=datetime.utcnow)
|
|
started_at = Column(TIMESTAMP)
|
|
completed_at = Column(TIMESTAMP)
|
|
|
|
# 产物
|
|
ipa_path = Column(String)
|
|
oss_url = Column(String)
|
|
dsym_path = Column(String)
|
|
obfuscation_maps_path = Column(String)
|
|
qr_code_path = Column(String)
|
|
build_dir = Column(String)
|
|
|
|
# 错误
|
|
error_message = Column(Text)
|
|
|
|
# 配置快照
|
|
config_json = Column(Text)
|
|
|
|
|
|
class BuildConfig(Base):
|
|
"""打包配置表"""
|
|
__tablename__ = "build_config"
|
|
|
|
key = Column(String, primary_key=True)
|
|
value = Column(String)
|
|
updated_at = Column(TIMESTAMP, default=datetime.utcnow, onupdate=datetime.utcnow)
|