首个可运行的版本

This commit is contained in:
2026-06-12 23:14:12 +08:00
commit b3d90c65f8
86 changed files with 4808 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
"""系统配置模型"""
from datetime import datetime, timezone
from sqlalchemy import String, Text, DateTime, ForeignKey
from sqlalchemy.orm import Mapped, mapped_column
from app.database import Base
class SystemConfig(Base):
__tablename__ = "system_configs"
id: Mapped[str] = mapped_column(String(36), primary_key=True)
key: Mapped[str] = mapped_column(String(100), unique=True, nullable=False, index=True)
value: Mapped[str] = mapped_column(Text, nullable=False)
updated_at: Mapped[datetime] = mapped_column(
DateTime,
default=lambda: datetime.utcnow(),
onupdate=lambda: datetime.utcnow(),
)
updated_by: Mapped[str | None] = mapped_column(
String(36), ForeignKey("users.id", ondelete="SET NULL"), nullable=True
)