2025-06-29 00:01:00 +07:00
|
|
|
use axum::{
|
|
|
|
|
Router,
|
|
|
|
|
routing::{delete, get, patch, post},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
pub mod testimonials_controller;
|
|
|
|
|
pub mod testimonials_dto;
|
|
|
|
|
pub mod testimonials_repository;
|
|
|
|
|
pub mod testimonials_schema;
|
|
|
|
|
pub mod testimonials_service;
|
|
|
|
|
|
2025-09-26 17:35:30 +07:00
|
|
|
// Export only the necessary public items
|
|
|
|
|
pub use testimonials_dto::{
|
|
|
|
|
TestimonialsCreateRequestDto,
|
|
|
|
|
TestimonialsUpdateRequestDto,
|
|
|
|
|
TestimonialsListItemDto,
|
|
|
|
|
TestimonialsDetailItemDto,
|
|
|
|
|
};
|
|
|
|
|
pub use testimonials_controller::{
|
|
|
|
|
get_testimonial_list,
|
|
|
|
|
get_testimonial_by_id,
|
|
|
|
|
post_create_testimonial,
|
|
|
|
|
patch_update_testimonial,
|
|
|
|
|
delete_testimonial,
|
|
|
|
|
};
|
2025-06-29 00:01:00 +07:00
|
|
|
|
|
|
|
|
pub fn testimonials_public_routes() -> Router {
|
|
|
|
|
Router::new()
|
2025-09-26 17:35:30 +07:00
|
|
|
.route("/cms/landing/testimonials", get(get_testimonial_list))
|
|
|
|
|
.route("/cms/landing/testimonials/detail/{id}", get(get_testimonial_by_id))
|
2025-06-29 00:01:00 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn testimonials_protected_routes() -> Router {
|
|
|
|
|
Router::new()
|
2025-09-26 17:35:30 +07:00
|
|
|
.route("/cms/landing/testimonials/create", post(post_create_testimonial))
|
|
|
|
|
.route("/cms/landing/testimonials/update/{id}", patch(patch_update_testimonial))
|
|
|
|
|
.route("/cms/landing/testimonials/delete/{id}", delete(delete_testimonial))
|
2025-06-29 00:01:00 +07:00
|
|
|
}
|