fix: landing

This commit is contained in:
Maulana Sodiqin
2025-05-26 23:09:01 +07:00
parent a3c2715a85
commit f1e4e02697
9 changed files with 83 additions and 63 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ use utoipa::{
Modify, OpenApi,
};
use imphnen_gacha::{gacha_claims, gacha_items, gacha_rolls, GachaClaimItemDto, GachaClaimRequestDto, GachaItemDto, GachaItemRequestDto, GachaRollItemDto, GachaRollRequestDto};
use imphnen_cms::v1::landing::events::{events_controller, events_dto::{EventsDetailItemDto, EventsListItemDto}};
use imphnen_cms::{events_controller, events_dto::{EventsDetailItemDto, EventsListItemDto}};
#[derive(OpenApi)]
+8 -4
View File
@@ -1,7 +1,7 @@
use axum::{
Extension, Router, middleware::from_fn, response::Redirect, routing::get,
};
use imphnen_cms::v1::landing::events::events_public_routes;
use imphnen_cms::{events_protected_routes, events_public_routes};
use imphnen_entities::{AppState, SurrealMemClient, SurrealWsClient};
use imphnen_gacha::gacha_router;
use imphnen_iam::{iam_protected_routes, iam_public_routes};
@@ -20,17 +20,21 @@ pub async fn gateway_service(
surrealdb_mem,
};
let public_routes = iam_public_routes();
let events_public_routes = events_public_routes();
let public_routes = Router::new()
.merge(iam_public_routes())
.merge(events_public_routes());
let protected_routes = Router::new()
.merge(iam_protected_routes())
.merge(events_protected_routes())
.merge(gacha_router())
.layer(from_fn(auth_middleware));
let routes = public_routes.merge(protected_routes);
Router::new()
.route("/", get(Redirect::to("/docs")))
.nest("/v1", public_routes.merge(protected_routes).merge(events_public_routes))
.nest("/v1", routes)
.merge(SwaggerUi::new("/docs").url("/openapi.json", docs_router()))
.layer(cors_middleware())
.layer(Extension(state))