Enhance Users Service and DTOs
- Added Default trait to UsersDetailItemDto for easier instantiation. - Refactored UsersServiceTrait to use Pin<Box<dyn Future<...>> for async functions, improving compatibility with async/await. - Updated all service methods to return futures instead of using async_trait. - Improved error handling and logging in upload_file method, ensuring proper handling of multipart data. - Masked sensitive information in Env struct's Debug implementation for better security in logs. - Cleaned up Cargo.toml by removing unnecessary async-trait workspace dependency.
This commit is contained in:
@@ -149,7 +149,7 @@ pub struct UsersUpdateRequestDto {
|
||||
pub career_status: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)]
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, ToSchema, Default)]
|
||||
pub struct UsersDetailItemDto {
|
||||
pub id: String,
|
||||
pub role: RolesDetailItemDto,
|
||||
@@ -400,4 +400,4 @@ impl UsersDetailItemDto {
|
||||
pub fn extract_permissions_from_user_role(&self) -> Vec<String> {
|
||||
self.role.permissions.iter().map(|p| p.name.clone()).collect()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user