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