feat: add gacha and init cms

This commit is contained in:
Maulana Sodiqin
2025-05-20 10:45:01 +07:00
parent f4b0ed0a4a
commit e63658c082
35 changed files with 976 additions and 171 deletions
+7 -2
View File
@@ -2,6 +2,7 @@ use axum::{
Extension, Router, middleware::from_fn, response::Redirect, routing::get,
};
use imphnen_entities::{AppState, SurrealMemClient, SurrealWsClient};
use imphnen_gacha::gacha_router;
use imphnen_iam::{iam_protected_routes, iam_public_routes};
use imphnen_middleware::{auth_middleware, cors_middleware};
use utoipa_swagger_ui::SwaggerUi;
@@ -19,12 +20,16 @@ pub async fn gateway_service(
};
let public_routes = iam_public_routes();
let protected_routes = iam_protected_routes().layer(from_fn(auth_middleware));
let protected_routes = Router::new()
.merge(iam_protected_routes())
.merge(gacha_router())
.layer(from_fn(auth_middleware));
Router::new()
.route("/", get(Redirect::to("/docs")))
.nest("/v1", public_routes.merge(protected_routes))
.merge(SwaggerUi::new("/docs").url("/openapi.json", docs_router()))
.layer(cors_middleware())
.layer(Extension(state.clone()))
.layer(Extension(state))
}