mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 09:50:21 +08:00
refactor: 大规模模块拆分与代码精简,新增 ai-pipeline/data-contracts 独立 crate
- 新增 aether-ai-pipeline 和 aether-data-contracts crate,将 pipeline 逻辑与数据契约从 gateway 中解耦 - 重构 admin handlers:拆分单体模块为 auth/billing/endpoint/features/model/observability/provider/system 等独立子模块 - 合并 chat/cli 重复代码路径:精简 conversion、finalize、planner 中的 sync/chat/cli 分支 - 重构 scheduler/executor/data 层,引入 facade 模式降低模块间耦合 - 移除冗余的 intent 模块,将 plan_fallback/policy/stream_path/sync_path 迁移至 executor - 前端适配:调整 admin API 调用和 provider 模型测试对话框
This commit is contained in:
15
apps/aether-gateway/src/handlers/admin/shared/mod.rs
Normal file
15
apps/aether-gateway/src/handlers/admin/shared/mod.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
mod paths;
|
||||
mod payloads;
|
||||
|
||||
pub(crate) use self::paths::*;
|
||||
pub(crate) use self::payloads::*;
|
||||
pub(crate) use crate::handlers::shared::{
|
||||
attach_admin_audit_response, build_admin_provider_key_response,
|
||||
decrypt_catalog_secret_with_fallbacks, default_provider_key_status_snapshot,
|
||||
effective_catalog_encryption_key, encrypt_catalog_secret_with_fallbacks, json_string_list,
|
||||
masked_catalog_api_key, normalize_json_array, normalize_json_object, normalize_string_list,
|
||||
parse_catalog_auth_config_json, provider_catalog_key_supports_format,
|
||||
provider_key_health_summary, provider_key_status_snapshot_payload, query_param_bool,
|
||||
query_param_optional_bool, query_param_value, unix_secs_to_rfc3339,
|
||||
OFFICIAL_EXTERNAL_MODEL_PROVIDERS,
|
||||
};
|
||||
37
apps/aether-gateway/src/handlers/admin/shared/paths.rs
Normal file
37
apps/aether-gateway/src/handlers/admin/shared/paths.rs
Normal file
@@ -0,0 +1,37 @@
|
||||
pub(crate) fn is_admin_gemini_files_mappings_root(request_path: &str) -> bool {
|
||||
matches!(
|
||||
request_path,
|
||||
"/api/admin/gemini-files/mappings" | "/api/admin/gemini-files/mappings/"
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn is_admin_gemini_files_stats_root(request_path: &str) -> bool {
|
||||
matches!(
|
||||
request_path,
|
||||
"/api/admin/gemini-files/stats" | "/api/admin/gemini-files/stats/"
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn is_admin_gemini_files_capable_keys_root(request_path: &str) -> bool {
|
||||
matches!(
|
||||
request_path,
|
||||
"/api/admin/gemini-files/capable-keys" | "/api/admin/gemini-files/capable-keys/"
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn is_admin_gemini_files_upload_root(request_path: &str) -> bool {
|
||||
matches!(
|
||||
request_path,
|
||||
"/api/admin/gemini-files/upload" | "/api/admin/gemini-files/upload/"
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn admin_gemini_file_mapping_id_from_path(request_path: &str) -> Option<String> {
|
||||
let raw = request_path.strip_prefix("/api/admin/gemini-files/mappings/")?;
|
||||
let normalized = raw.trim().trim_matches('/');
|
||||
if normalized.is_empty() || normalized.contains('/') {
|
||||
None
|
||||
} else {
|
||||
Some(normalized.to_string())
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user