feat: 统一 JSON API 到 /v1 前缀,移除旧邮件兼容路由
- 删除旧邮件查询兼容路由 GET /mail-api/messages、/mail-api/messages/{id}、/mail-api/search
- 所有 JSON API 统一使用 /v1/...:邮件、上下文记忆、动态页面创建和健康检查接口
- 页面路由保持非 /v1 地址:/mail、/mail/messages/{id}、/mail/{slug}、/web/{page_type}/{slug}、/updates
- AI 内部工具调用同步改用 /v1/web/pages 与 /v1/context/memories...
- 无数据库结构变化,新增 0.1.14 升级日志记录
This commit is contained in:
+18
-3
@@ -2,13 +2,13 @@ mod cli;
|
||||
|
||||
use clap::Parser;
|
||||
use cli::{Channels, Cli, Commands, MailAction, ServiceAction, WechatAction};
|
||||
use ias_service::supervisor::{
|
||||
print_logs, restart_service, start_service, status_service, stop_service,
|
||||
};
|
||||
use ias_service::{
|
||||
connect_db, delete_account, init_logging, list_accounts, login_user, rename_account,
|
||||
run_service,
|
||||
};
|
||||
use ias_service::supervisor::{
|
||||
print_logs, restart_service, start_service, status_service, stop_service,
|
||||
};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
@@ -48,6 +48,21 @@ async fn main() -> anyhow::Result<()> {
|
||||
match command {
|
||||
MailAction::Auth => ias_mail::auth::auth_account(&pool).await?,
|
||||
MailAction::List => ias_mail::auth::list_accounts(&pool).await?,
|
||||
MailAction::Show { id } => ias_mail::auth::show_account(&pool, id).await?,
|
||||
MailAction::Edit { id } => ias_mail::auth::edit_account(&pool, id).await?,
|
||||
MailAction::Check { id } => ias_mail::auth::check_account(&pool, id).await?,
|
||||
MailAction::Pull { id } => ias_mail::auth::pull_mail(&pool, id).await?,
|
||||
MailAction::Delete { id } => ias_mail::auth::delete_account(&pool, id).await?,
|
||||
MailAction::Enable { id } => {
|
||||
ias_mail::auth::enable_account(&pool, id, true).await?
|
||||
}
|
||||
MailAction::Disable { id } => {
|
||||
ias_mail::auth::enable_account(&pool, id, false).await?
|
||||
}
|
||||
MailAction::Messages { page, per_page } => {
|
||||
ias_mail::auth::list_messages(&pool, page, per_page).await?
|
||||
}
|
||||
MailAction::Message { id } => ias_mail::auth::show_message(&pool, id).await?,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user