1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-07-03 14:43:28 +00:00

Can access admin logs from the API

This commit is contained in:
2021-07-10 19:40:41 +02:00
parent b20c261c7d
commit 5d97ca18cb
10 changed files with 86 additions and 11 deletions

View File

@ -0,0 +1,26 @@
//! # Admin log api entry
//!
//! @author Pierre Hubert
use crate::data::admin_action_log::{AdminActionLog, AdminAction};
#[derive(serde::Serialize)]
pub struct AdminLogAPI {
id: u64,
admin_id: u64,
ip: String,
time: u64,
action: AdminAction
}
impl AdminLogAPI {
pub fn new(log: &AdminActionLog) -> Self{
Self {
id: log.id,
admin_id: log.admin_id.id(),
ip: log.ip.to_string(),
time: log.time,
action: log.action.clone()
}
}
}

View File

@ -9,4 +9,5 @@ pub mod admin_info_api;
pub mod admin_keys_api;
pub mod admin_res_create_reset_token;
pub mod admin_role_api;
pub mod admin_res_create_account;
pub mod admin_res_create_account;
pub mod admin_log_api;