1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-03-14 09:52:37 +00:00
comunicapiv3/src/api_data/user_info.rs

24 lines
471 B
Rust
Raw Normal View History

2020-05-25 13:25:51 +02:00
//! API representation of user information
//!
//! @author Pierre Hubert
use serde::Serialize;
use crate::data::user::User;
#[derive(Serialize)]
#[allow(non_snake_case)]
pub struct APIUserInfo {
userID: i64,
firstName: String,
lastName: String,
}
impl APIUserInfo {
pub fn new(info: User) -> APIUserInfo {
APIUserInfo {
userID: info.id,
firstName: info.first_name,
lastName: info.last_name,
}
}
}