gitdataai/libs/api/admin/mod.rs
ZhenYi ef767297f7 chore(api): remove admin AI model CRUD routes
Admin Next.js app now handles DB access directly for provider/model/
version/pricing management. Keep only health, sync, alerts, and billing.
2026-04-26 14:04:01 +08:00

36 lines
1.0 KiB
Rust

//! Admin API endpoints — protected by `x-admin-api-key` header.
//!
//! Only platform-wide operations remain. AI model management is handled
//! directly by the admin Next.js app via database access.
use actix_web::web;
pub mod alerts;
pub mod billing;
pub mod sync;
pub fn init_admin_routes(cfg: &mut web::ServiceConfig) {
cfg.service(
web::scope("/api/admin")
.route("/health", web::get().to(health_check))
.route("/ai/sync", web::post().to(sync::admin_sync_models))
.route("/alerts/check", web::post().to(alerts::admin_check_alerts))
.route(
"/workspaces/{slug}/add-credit",
web::post().to(billing::admin_workspace_add_credit),
),
);
}
#[utoipa::path(
get,
path = "/api/admin/health",
responses(
(status = 200, description = "Admin API is healthy"),
),
tag = "Admin"
)]
async fn health_check() -> impl actix_web::Responder {
actix_web::HttpResponse::Ok().json(serde_json::json!({ "ok": true }))
}