mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-08-31 05:52:30 +00:00
Addd admin models to database
This commit is contained in:
@@ -1,17 +1,28 @@
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
use std::{
|
||||
collections::{BTreeMap, HashMap},
|
||||
sync::Arc,
|
||||
};
|
||||
|
||||
use futures::lock::Mutex;
|
||||
|
||||
use crate::{
|
||||
Bot, Channel, ChannelCompositeKey, ChannelUnread, Emoji, File, FileHash, Invite, Member,
|
||||
MemberCompositeKey, Message, PolicyChange, RatelimitEvent, Report, Server, ServerBan, Snapshot,
|
||||
User, UserSettings, Webhook,
|
||||
AdminAuditItem, AdminCase, AdminCaseComment, AdminObjectNote, AdminStrike, AdminToken,
|
||||
AdminUser, Bot, Channel, ChannelCompositeKey, ChannelUnread, Emoji, File, FileHash, Invite,
|
||||
Member, MemberCompositeKey, Message, PolicyChange, RatelimitEvent, Report, Server, ServerBan,
|
||||
Snapshot, User, UserSettings, Webhook,
|
||||
};
|
||||
|
||||
database_derived!(
|
||||
/// Reference implementation
|
||||
#[derive(Default)]
|
||||
pub struct ReferenceDb {
|
||||
pub admin_audits: Arc<Mutex<BTreeMap<String, AdminAuditItem>>>,
|
||||
pub admin_cases: Arc<Mutex<HashMap<String, AdminCase>>>,
|
||||
pub admin_case_comments: Arc<Mutex<HashMap<String, AdminCaseComment>>>,
|
||||
pub admin_object_notes: Arc<Mutex<HashMap<String, AdminObjectNote>>>,
|
||||
pub admin_strikes: Arc<Mutex<HashMap<String, AdminStrike>>>,
|
||||
pub admin_tokens: Arc<Mutex<HashMap<String, AdminToken>>>,
|
||||
pub admin_users: Arc<Mutex<HashMap<String, AdminUser>>>,
|
||||
pub bots: Arc<Mutex<HashMap<String, Bot>>>,
|
||||
pub channels: Arc<Mutex<HashMap<String, Channel>>>,
|
||||
pub channel_invites: Arc<Mutex<HashMap<String, Invite>>>,
|
||||
|
||||
Reference in New Issue
Block a user