refactor: migrate to clean architecture with trait-based DI (v0.2.0)
Complete architectural overhaul across all 12 crates: - Replace validator crate with zod-rs for all DTO validation - Replace manual pagination with paginator-rs/paginator-sea-orm - Migrate all modules (iam, cms, gacha, dimentorin) to clean architecture: domain → application → infrastructure layers - Introduce trait-based DI (Arc<dyn Trait>) at every layer for repositories and services - Delete all v1/ legacy SurrealDB-era code across every crate - Replace opaque response helpers with typed IntoResponse structs (ApiSuccess, ApiCreated, ApiPaginated, ApiMessage) - Remove dual_mode_repository, migration_validation_errors, validator.rs dead code - Zero cargo clippy warnings; release build clean Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
1b3366d735
commit
e432a1a743
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "imphnen-entities"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -7,31 +7,6 @@ pub struct MessageResponseDto {
|
||||
pub version: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, IntoParams)]
|
||||
pub struct MetaRequestDto {
|
||||
pub page: Option<u64>,
|
||||
pub per_page: Option<u64>,
|
||||
pub search: Option<String>,
|
||||
pub sort_by: Option<String>,
|
||||
pub order: Option<String>,
|
||||
pub filter: Option<String>,
|
||||
pub filter_by: Option<String>,
|
||||
}
|
||||
|
||||
impl Default for MetaRequestDto {
|
||||
fn default() -> Self {
|
||||
MetaRequestDto {
|
||||
page: Some(1),
|
||||
per_page: Some(10),
|
||||
search: None,
|
||||
sort_by: None,
|
||||
order: None,
|
||||
filter: None,
|
||||
filter_by: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, IntoParams)]
|
||||
pub struct MetaResponseDto {
|
||||
pub page: Option<u64>,
|
||||
@@ -58,7 +33,3 @@ pub struct ErrorDto {
|
||||
pub details: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize)]
|
||||
pub struct CountResult {
|
||||
pub count: u64,
|
||||
}
|
||||
|
||||
@@ -5,21 +5,13 @@ pub mod permissions;
|
||||
pub mod audit_log;
|
||||
pub mod seaorm;
|
||||
|
||||
// Re-export error type at root level for convenience
|
||||
pub use error_dto::error::Error;
|
||||
|
||||
// Explicit common_dto exports
|
||||
pub use common_dto::CountResult;
|
||||
pub use common_dto::ErrorDto;
|
||||
pub use common_dto::MessageResponseDto;
|
||||
pub use common_dto::MetaRequestDto;
|
||||
pub use common_dto::MetaResponseDto;
|
||||
pub use common_dto::ResponseListSuccessDto;
|
||||
pub use common_dto::ResponseSuccessDto;
|
||||
|
||||
// Explicit users exports
|
||||
pub use users::EducationDto;
|
||||
pub use users::ExperienceDto;
|
||||
pub use users::RolesDetailItemDto;
|
||||
pub use users::RolesDetailQueryDto;
|
||||
pub use users::UsersDetailQueryDto;
|
||||
|
||||
Reference in New Issue
Block a user