2026-04-09 00:10:38 +08:00
|
|
|
use crate::handlers::admin::request::{AdminAppState, AdminRequestContext};
|
|
|
|
|
use crate::GatewayError;
|
2026-04-07 02:50:19 +08:00
|
|
|
use axum::body::{Body, Bytes};
|
|
|
|
|
use axum::http::Response;
|
|
|
|
|
|
|
|
|
|
mod architectures;
|
2026-04-07 12:15:19 +08:00
|
|
|
pub(crate) mod providers;
|
2026-04-07 02:50:19 +08:00
|
|
|
|
|
|
|
|
pub(crate) async fn maybe_build_local_admin_provider_ops_response(
|
2026-04-09 00:10:38 +08:00
|
|
|
state: &AdminAppState<'_>,
|
|
|
|
|
request_context: &AdminRequestContext<'_>,
|
2026-04-07 02:50:19 +08:00
|
|
|
request_body: Option<&Bytes>,
|
|
|
|
|
) -> Result<Option<Response<Body>>, GatewayError> {
|
|
|
|
|
if let Some(response) =
|
|
|
|
|
architectures::maybe_build_local_admin_provider_ops_architectures_response(request_context)
|
|
|
|
|
.await?
|
|
|
|
|
{
|
|
|
|
|
return Ok(Some(response));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if let Some(response) = providers::maybe_build_local_admin_provider_ops_providers_response(
|
|
|
|
|
state,
|
|
|
|
|
request_context,
|
|
|
|
|
request_body,
|
|
|
|
|
)
|
|
|
|
|
.await?
|
|
|
|
|
{
|
|
|
|
|
return Ok(Some(response));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ok(None)
|
|
|
|
|
}
|