crud testi

This commit is contained in:
0x6d696b7566616e
2025-06-29 00:01:00 +07:00
parent cfa251337f
commit fa435994f2
12 changed files with 581 additions and 4 deletions
+10 -3
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::{events_controller, events_dto::{EventsDetailItemDto, EventsListItemDto}};
use imphnen_cms::{events_controller, events_dto::{EventsDetailItemDto, EventsListItemDto}, testimonials_controller, testimonials_dto::{TestimonialsCreateRequestDto, TestimonialsDetailItemDto, TestimonialsListItemDto, TestimonialsUpdateRequestDto}};
#[derive(OpenApi)]
@@ -52,6 +52,11 @@ use imphnen_cms::{events_controller, events_dto::{EventsDetailItemDto, EventsLis
events_controller::post_create_event,
events_controller::patch_update_event,
events_controller::delete_event,
testimonials_controller::get_testimonial_list,
testimonials_controller::get_testimonial_by_id,
testimonials_controller::post_create_testimonial,
testimonials_controller::patch_update_testimonial,
testimonials_controller::delete_testimonial,
),
components(
schemas(
@@ -93,8 +98,10 @@ use imphnen_cms::{events_controller, events_dto::{EventsDetailItemDto, EventsLis
ResponseSuccessDto<PermissionsItemDto>,
ResponseListSuccessDto<Vec<EventsListItemDto>>,
ResponseSuccessDto<EventsDetailItemDto>,
MessageResponseDto,
MessageResponseDto,
ResponseListSuccessDto<Vec<TestimonialsListItemDto>>,
ResponseSuccessDto<TestimonialsDetailItemDto>,
TestimonialsCreateRequestDto,
TestimonialsUpdateRequestDto,
MessageResponseDto,
)
),
+6 -1
View File
@@ -1,7 +1,10 @@
use axum::{
Extension, Router, middleware::from_fn, response::Redirect, routing::get,
};
use imphnen_cms::{events_protected_routes, events_public_routes};
use imphnen_cms::{
events_protected_routes, events_public_routes, testimonials_protected_routes,
testimonials_public_routes,
};
use imphnen_entities::{AppState, SurrealMemClient, SurrealWsClient};
use imphnen_gacha::gacha_router;
use imphnen_iam::{iam_protected_routes, iam_public_routes};
@@ -22,11 +25,13 @@ pub async fn gateway_service(
let public_routes = Router::new()
.merge(iam_public_routes())
.merge(testimonials_public_routes())
.merge(events_public_routes());
let protected_routes = Router::new()
.merge(iam_protected_routes())
.merge(events_protected_routes())
.merge(testimonials_protected_routes())
.merge(gacha_router())
.layer(from_fn(auth_middleware));