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, } impl LoginResponse { #[must_use] pub fn new(user: &users::Model, token: &String) -> Self { Self { token: token.to_string(), pid: user.pid.to_string(), name: user.name.clone(), } } }