1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-07-03 22:45:01 +00:00

Can create new admin accounts from command line

This commit is contained in:
2021-05-08 19:17:33 +02:00
parent d84b7051fb
commit c0489613fb
7 changed files with 170 additions and 4 deletions

41
src/data/admin.rs Normal file
View File

@ -0,0 +1,41 @@
//! # Comunic administrator
//!
//! @author Pierre Hubert
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct AdminID(u64);
impl AdminID {
pub fn new(id: u64) -> Self {
Self(id)
}
pub fn id(&self) -> u64 {
self.0
}
}
pub struct NewAdmin {
pub name: String,
pub email: String,
}
pub struct AdminResetToken {
pub token: String,
pub expire: u64,
}
pub struct Admin {
pub id: AdminID,
pub time_create: u64,
pub name: String,
pub email: String,
pub reset_token: Option<AdminResetToken>,
}
pub struct AdminKey {
pub id: u64,
pub admin_id: AdminID,
pub name: String,
pub key: String,
}

View File

@ -40,4 +40,5 @@ pub mod user_ws_connection;
pub mod call_signal;
pub mod new_notifications_settings;
pub mod push_notification;
pub mod presence;
pub mod presence;
pub mod admin;