Files
company-ai-platform/app/modules/feishu/models.py
JiuContinent 514b14d390 ```
feat: 添加飞书集成和审计API密钥认证

- 在数据库配置中添加飞书模型导入
- 添加审计API密钥配置项和认证中间件
- 实现飞书事件重复处理防止机制
- 为审批路由添加API密钥认证
- 优化AI适配器错误处理并添加JSON解析异常捕获
- 更新测试用例以包含新的认证和事件处理逻辑
```
2026-07-06 11:34:15 +08:00

19 lines
774 B
Python

from datetime import datetime
from sqlalchemy import DateTime, Integer, String
from sqlalchemy.orm import Mapped, mapped_column
from app.core.db_base import Base
from app.core.time import utc_now
class FeishuEventReceipt(Base):
__tablename__ = "feishu_event_receipts"
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
event_key: Mapped[str] = mapped_column(String(256), unique=True, index=True)
source: Mapped[str] = mapped_column(String(64), index=True)
event_id: Mapped[str | None] = mapped_column(String(128), nullable=True, index=True)
message_id: Mapped[str | None] = mapped_column(String(128), nullable=True, index=True)
received_at: Mapped[datetime] = mapped_column(DateTime, default=utc_now, index=True)