gitdataai/libs/api/admin/mod.rs
ZhenYi 8ea826e6ad chore(api): remove admin billing endpoint
Admin Next.js app handles billing directly via database access now.
2026-04-26 14:05:52 +08:00

31 lines
891 B
Rust

//! Admin API endpoints — protected by `x-admin-api-key` header.
//!
//! Only platform-wide operations remain. AI model management and billing
//! are handled directly by the admin Next.js app via database access.
use actix_web::web;
pub mod alerts;
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)),
);
}
#[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 }))
}