feat: deliver agent foundation day 1

This commit is contained in:
caoxiaozhu
2026-05-11 03:51:24 +00:00
parent f738b6cdd4
commit b2beeaa136
54 changed files with 6747 additions and 1724 deletions

View File

@@ -0,0 +1,25 @@
from __future__ import annotations
import uuid
from datetime import datetime
from typing import Any
from sqlalchemy import DateTime, String, func
from sqlalchemy.orm import Mapped, mapped_column
from sqlalchemy.types import JSON
from app.db.base_class import Base
class AuditLog(Base):
__tablename__ = "audit_logs"
id: Mapped[str] = mapped_column(String(36), primary_key=True, default=lambda: str(uuid.uuid4()))
actor: Mapped[str] = mapped_column(String(100))
action: Mapped[str] = mapped_column(String(100), index=True)
resource_type: Mapped[str] = mapped_column(String(50), index=True)
resource_id: Mapped[str] = mapped_column(String(100), index=True)
before_json: Mapped[dict[str, Any] | None] = mapped_column(JSON, nullable=True)
after_json: Mapped[dict[str, Any] | None] = mapped_column(JSON, nullable=True)
request_id: Mapped[str] = mapped_column(String(64), index=True)
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())