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:
26
src/api_data/admin/admin_info_api.rs
Normal file
26
src/api_data/admin/admin_info_api.rs
Normal 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,
|
||||
}
|
||||
}
|
||||
}
|
@ -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;
|
Reference in New Issue
Block a user