Init
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
use std::sync::Arc;
|
||||
use sea_orm::DatabaseConnection;
|
||||
use crate::event_bus::EventBus;
|
||||
use crate::repositories::category::CategoryRepository;
|
||||
use crate::repositories::channel::ChannelRepository;
|
||||
use crate::repositories::message::MessageRepository;
|
||||
use crate::repositories::server::ServerRepository;
|
||||
use crate::repositories::user::UserRepository;
|
||||
|
||||
mod server;
|
||||
mod category;
|
||||
@@ -18,6 +22,10 @@ pub struct RepositoryContext {
|
||||
#[derive(Clone)]
|
||||
pub struct Repositories {
|
||||
pub server: ServerRepository,
|
||||
pub category: CategoryRepository,
|
||||
pub channel: ChannelRepository,
|
||||
pub message: MessageRepository,
|
||||
pub user: UserRepository,
|
||||
}
|
||||
|
||||
impl Repositories {
|
||||
@@ -26,6 +34,10 @@ impl Repositories {
|
||||
|
||||
Self {
|
||||
server: ServerRepository {context: context.clone()},
|
||||
category: CategoryRepository {context: context.clone()},
|
||||
channel: ChannelRepository {context: context.clone()},
|
||||
message: MessageRepository {context: context.clone()},
|
||||
user: UserRepository {context: context.clone()},
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user