1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-07-07 16:22:48 +00:00

Can get the list of keys of an admin

This commit is contained in:
2021-05-14 13:34:13 +02:00
parent 3c4a5a53a1
commit 22b3a73db3
6 changed files with 44 additions and 8 deletions

View File

@ -0,0 +1,23 @@
//! # Admin keys API
//!
//! @author Pierre Hubert
use serde::Serialize;
use crate::data::admin::AdminKey;
#[derive(Serialize)]
pub struct AdminKeyAPI {
id: u64,
name: String,
time_add: u64,
}
impl AdminKeyAPI {
pub fn new(key: &AdminKey) -> Self {
Self {
id: key.id,
name: key.name.to_string(),
time_add: key.time_add,
}
}
}

View File

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