Files
auth_service_rust/src/model.rs
T

65 lines
1.3 KiB
Rust

use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone)]
pub struct User {
pub id: String,
pub username: String,
pub email: String,
pub password: String,
pub group: String,
pub is_superuser: bool,
}
#[derive(Debug, Deserialize)]
pub struct GetUserByIdRequest {
pub id: String,
}
#[derive(Debug, Deserialize)]
pub struct GetUserByUsernameRequest {
pub username: String,
}
#[derive(Debug, Deserialize, Clone)]
pub struct AddUserRequest {
pub id: String,
pub username: String,
pub email: String,
pub password: String,
pub group: String,
pub is_superuser: bool,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct GetUserResponse {
pub id: String,
pub username: String,
pub email: String,
pub group: String,
pub is_superuser: bool,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct DeleteUserRequest {
pub id: String,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct DeleteUserResponse {
pub success: bool,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct UpdateUserRequest {
pub id: String,
pub username: String,
pub email: String,
pub group: String,
pub is_superuser: bool,
}
#[derive(Serialize, Debug)]
pub struct ErrorResponse {
pub error: String,
}