- Updated `lib.rs` to selectively expose specific entities and services for better clarity. - Improved SurrealDB client initialization with detailed logging in `surrealdb/mod.rs`. - Enhanced resource definitions in `resource.rs` with additional utility methods for better resource management. - Refactored user data retrieval logic in `auth_middleware/mod.rs` for improved readability and efficiency. - Cleaned up middleware exports in `lib.rs` for clearer API surface. - Added detailed comments and documentation throughout the SurrealDB module for better maintainability. - Updated tests to ensure compatibility with new changes and improved structure. - Introduced new permissions module structure in `imphnen-utils` for future enhancements.
39 lines
1.1 KiB
Rust
39 lines
1.1 KiB
Rust
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;
|
|
|
|
// 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,
|
|
};
|
|
|
|
pub fn testimonials_public_routes() -> Router {
|
|
Router::new()
|
|
.route("/cms/landing/testimonials", get(get_testimonial_list))
|
|
.route("/cms/landing/testimonials/detail/{id}", get(get_testimonial_by_id))
|
|
}
|
|
|
|
pub fn testimonials_protected_routes() -> Router {
|
|
Router::new()
|
|
.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))
|
|
}
|