mirror of
https://github.com/hongguang1994/SimNexus.git
synced 2026-12-05 14:37:53 +08:00
功能: - Telegram bot 长轮询,收件自动推送,支持 /send /list /modems /help 命令 - Web 管理界面 /admin/telegram:收发文字/图片/文件,内联预览,灯箱放大 - 短信历史页改版:状态徽章、方向标签、设备列,支持单条/批量删除并同步清理设备内存 - Dashboard 图表化,浅色主题 CSS 变量体系 文档: - CLAUDE.md 补充 Telegram 集成章节和环境变量说明 - docs/schema.sql 新增 telegram_messages 表 - docs/database-schema.md 更新表总览、外键关系图、Telegram 域说明 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
18 lines
725 B
Python
18 lines
725 B
Python
from sqlalchemy import Column, Integer, String, DateTime, Text, Boolean
|
|
from datetime import datetime
|
|
from app.core.database import Base
|
|
|
|
|
|
class TelegramMessage(Base):
|
|
__tablename__ = "telegram_messages"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
chat_id = Column(String(64), nullable=False, index=True)
|
|
username = Column(String(128), nullable=True)
|
|
direction = Column(String(8), nullable=False) # "in" | "out"
|
|
text = Column(Text, nullable=False)
|
|
created_at = Column(DateTime, default=datetime.utcnow)
|
|
is_command = Column(Boolean, default=False)
|
|
file_id = Column(String(256), nullable=True)
|
|
file_type = Column(String(32), nullable=True) # photo | document | video | sticker
|