better project structure
Some checks failed
CI / Check Style (push) Has been cancelled
CI / Run Clippy (push) Has been cancelled
CI / Run Tests (push) Has been cancelled

This commit is contained in:
Priec
2026-06-16 22:48:10 +02:00
parent b255e95051
commit 9ce07e8c23
53 changed files with 2016 additions and 1775 deletions

View File

@@ -1,45 +0,0 @@
use serde::{Deserialize, Serialize};
use crate::models::_entities::users;
#[derive(Debug, Deserialize, Serialize)]
pub struct LoginResponse {
pub token: String,
pub pid: String,
pub name: String,
pub is_verified: bool,
pub is_admin: bool,
}
impl LoginResponse {
#[must_use]
pub fn new(user: &users::Model, token: &String, is_admin: bool) -> Self {
Self {
token: token.to_string(),
pid: user.pid.to_string(),
name: user.name.clone(),
is_verified: user.email_verified_at.is_some(),
is_admin,
}
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct CurrentResponse {
pub pid: String,
pub name: String,
pub email: String,
pub is_admin: bool,
}
impl CurrentResponse {
#[must_use]
pub fn new(user: &users::Model, is_admin: bool) -> Self {
Self {
pid: user.pid.to_string(),
name: user.name.clone(),
email: user.email.clone(),
is_admin,
}
}
}

View File

@@ -1 +0,0 @@
pub mod auth;