feat(admin): 实现系统数据导入导出功能,支持提供商和模型批量配置

This commit is contained in:
fawney19
2026-04-11 21:39:04 +08:00
parent 801e16c988
commit a9f610fa69
36 changed files with 3247 additions and 409 deletions
@@ -1,3 +1,4 @@
use crate::handlers::admin::shared::AdminTypedObjectPatch;
use serde::Deserialize;
#[derive(Debug, Deserialize)]
@@ -83,6 +84,8 @@ pub(crate) struct AdminProviderKeyUpdateRequest {
pub(crate) fingerprint: Option<serde_json::Value>,
}
pub(crate) type AdminProviderKeyUpdatePatch = AdminTypedObjectPatch<AdminProviderKeyUpdateRequest>;
#[derive(Debug, Deserialize)]
pub(crate) struct AdminProviderKeyBatchDeleteRequest {
pub(crate) ids: Vec<String>,
@@ -187,6 +190,8 @@ pub(crate) struct AdminProviderUpdateRequest {
pub(crate) config: Option<serde_json::Value>,
}
pub(crate) type AdminProviderUpdatePatch = AdminTypedObjectPatch<AdminProviderUpdateRequest>;
pub(crate) const CODEX_WHAM_USAGE_URL: &str = "https://chatgpt.com/backend-api/wham/usage";
pub(crate) const KIRO_USAGE_LIMITS_PATH: &str = "/getUsageLimits";
pub(crate) const KIRO_USAGE_SDK_VERSION: &str = "1.0.0";
@@ -248,6 +253,9 @@ pub(crate) struct AdminProviderModelUpdateRequest {
pub(crate) config: Option<serde_json::Value>,
}
pub(crate) type AdminProviderModelUpdatePatch =
AdminTypedObjectPatch<AdminProviderModelUpdateRequest>;
#[derive(Debug, Deserialize)]
pub(crate) struct AdminBatchAssignGlobalModelsRequest {
pub(crate) global_model_ids: Vec<String>,