Billy Chan 9fd5523d65
Examples: Loco x Seaography (#2270)
* Examples: Loco x Seaography

* fmt

* Edit
2024-06-26 14:50:00 +08:00

22 lines
448 B
Rust

use serde::{Deserialize, Serialize};
use crate::models::_entities::users;
#[derive(Debug, Deserialize, Serialize)]
pub struct CurrentResponse {
pub pid: String,
pub name: String,
pub email: String,
}
impl CurrentResponse {
#[must_use]
pub fn new(user: &users::Model) -> Self {
Self {
pid: user.pid.to_string(),
name: user.name.clone(),
email: user.email.clone(),
}
}
}