1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-20 16:35:17 +00:00

Can get admin information

This commit is contained in:
2021-05-11 17:41:03 +02:00
parent ef0845f075
commit 8f9021d8ef
6 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,26 @@
//! # Admin information API
//!
//! @author Pierre Hubert
use serde::Serialize;
use crate::data::admin::Admin;
#[derive(Serialize)]
pub struct AdminInfoAPI {
id: u64,
name: String,
email: String,
time_create: u64,
}
impl AdminInfoAPI {
pub fn new(a: &Admin) -> Self {
Self {
id: a.id.id(),
name: a.name.clone(),
email: a.email.clone(),
time_create: a.time_create,
}
}
}

View File

@ -4,4 +4,5 @@
pub mod admin_auth_options;
pub mod admin_auth_success;
pub mod admin_id_api;
pub mod admin_id_api;
pub mod admin_info_api;