feat: 0.2.27 - 抽离数据库基础设施模块

- 新增 ias-db crate,集中管理 PostgreSQL 连接池和 SQLx 迁移
- 迁移 ias-service/migrations 到 ias-db/migrations
- ias-main 改用 ias_db::connect_db(),ias-service 只接 PgPool
- 新增操作日志 HTTP 查询接口 (GET /v1/logs, GET /v1/logs/{id})
- 新增操作日志 Web 前端页面,支持按级别/模块/关键词筛选
- 消息队列关键节点增加操作日志写入
- ias-mail 新增 mark_remote_message_seen,IMAP 已读同步
- 工作流配置加载改为文件级容错 (load_configs_with_warnings)
- ias-context 工具调用说明更新为 query_api_docs + call_http_api
- 新增高德地图地理编码 HTTP 能力配置

模块版本: ias-db 0.1.0, ias-ai 0.1.14, ias-context 0.1.6, ias-http 0.1.15, ias-mail 0.1.16, ias-service 0.1.25, ias-main 0.2.27
This commit is contained in:
2026-07-08 17:44:21 +08:00
parent 7d5140c8d2
commit 7deae286ca
83 changed files with 1440 additions and 107 deletions
@@ -0,0 +1,48 @@
CREATE TABLE ias_mail_messages (
id BIGSERIAL PRIMARY KEY,
source_key VARCHAR(512) NOT NULL,
mailbox VARCHAR(255) NOT NULL,
uid VARCHAR(255) NOT NULL,
message_id TEXT,
from_label TEXT NOT NULL DEFAULT '',
subject TEXT NOT NULL DEFAULT '',
summary TEXT NOT NULL DEFAULT '',
content_preview TEXT NOT NULL DEFAULT '',
preview_page_id BIGINT REFERENCES ias_web_pages(id) ON DELETE SET NULL,
preview_url TEXT,
received_at TIMESTAMPTZ,
raw_size BIGINT NOT NULL DEFAULT 0,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
UNIQUE (source_key, mailbox, uid)
);
CREATE INDEX idx_ias_mail_messages_created
ON ias_mail_messages(created_at DESC);
CREATE INDEX idx_ias_mail_messages_received
ON ias_mail_messages(received_at DESC);
INSERT INTO ias_upgrade_logs (
version,
released_at,
title,
description,
changes
) VALUES (
'0.1.4',
'2026-07-06T00:00:00+08:00',
'Mail polling and standalone HTTP module',
'Added a standalone mail module for IMAP polling and notifications, moved HTTP serving and web preview pages into a standalone Rust module, and added mail persistence tables.',
'[
"Added the standalone Rust mail module for IMAP mailbox polling, message parsing, database deduplication, preview-page creation, and user notifications.",
"Added the standalone Rust ias-http module for HTTP serving, health checks, and reusable web preview pages.",
"Moved the existing web preview routes out of service and into ias-http.",
"Added /mail-api/messages and /mail-api/messages/{id} for inspecting stored mail records.",
"Added the ias_mail_messages database table and persisted the 0.1.4 upgrade record.",
"Added mail polling configuration through IA_MAIL_* environment variables; polling stays disabled when mailbox settings are absent."
]'::jsonb
) ON CONFLICT (version) DO UPDATE SET
released_at = EXCLUDED.released_at,
title = EXCLUDED.title,
description = EXCLUDED.description,
changes = EXCLUDED.changes;