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