mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-03-14 09:52:37 +00:00
24 lines
471 B
Rust
24 lines
471 B
Rust
|
//! 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,
|
||
|
}
|
||
|
}
|
||
|
}
|