This commit is contained in:
2026-03-01 03:33:36 +01:00
parent 68f16055a8
commit e982ea372f
26 changed files with 496 additions and 550 deletions

View File

@@ -7,6 +7,7 @@ use uuid::Uuid;
pub struct UserResponse {
pub id: Uuid,
pub username: String,
pub pub_key: String,
}
impl From<user::Model> for UserResponse {
@@ -14,6 +15,7 @@ impl From<user::Model> for UserResponse {
Self {
id: model.id,
username: model.username,
pub_key: model.pub_key,
}
}
}
@@ -31,3 +33,10 @@ impl From<CreateUserRequest> for user::ActiveModel {
}
}
}
impl CreateUserRequest {
pub fn apply_to(self, mut am: user::ActiveModel) -> user::ActiveModel {
am.username = Set(self.username);
am
}
}