AI Agent 定时任务跟踪、监控、状态看板系统。 - FastAPI + Vue3 单体应用 - AI Agent 一键接入(批量注册 API) - 暗色主题 Dashboard - 后台调度器 + 超时告警 - 飞书/邮件/Webhook 多渠道通知 - Base URL 可配置 - Gunicorn 生产部署
22 lines
838 B
Python
22 lines
838 B
Python
"""SQLAlchemy models — SystemConfig (key-value store for system settings)."""
|
|
|
|
from datetime import datetime
|
|
|
|
from sqlalchemy import DateTime, String, Text, func
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.database import Base
|
|
|
|
|
|
class SystemConfig(Base):
|
|
"""System-level configuration stored as key-value pairs."""
|
|
__tablename__ = "system_config"
|
|
|
|
key: Mapped[str] = mapped_column(String(128), primary_key=True, comment="配置键名")
|
|
value: Mapped[str] = mapped_column(Text, nullable=False, comment="配置值 (JSON)")
|
|
description: Mapped[str] = mapped_column(String(256), default="", comment="描述")
|
|
updated_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now(), onupdate=func.now())
|
|
|
|
def __repr__(self) -> str:
|
|
return f"<SystemConfig {self.key}={self.value}>"
|