pre-metrics
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
pub type AnyResult<T> = anyhow::Result<T>;
|
||||
|
||||
use crate::repositories::category::CategoryRepository;
|
||||
use crate::repositories::channel::ChannelRepository;
|
||||
use crate::repositories::group::GroupRepository;
|
||||
@@ -16,13 +18,13 @@ mod server;
|
||||
pub mod types;
|
||||
mod user;
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct RepositoryContext {
|
||||
db: DatabaseConnection,
|
||||
events: Arc<EventBus>,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Repositories {
|
||||
pub server: ServerRepository,
|
||||
pub category: CategoryRepository,
|
||||
@@ -33,11 +35,8 @@ pub struct Repositories {
|
||||
}
|
||||
|
||||
impl Repositories {
|
||||
pub fn new(db: &DatabaseConnection, events: Arc<EventBus>) -> Self {
|
||||
let context = Arc::new(RepositoryContext {
|
||||
db: db.clone(),
|
||||
events,
|
||||
});
|
||||
pub fn new(db: DatabaseConnection, events: Arc<EventBus>) -> Self {
|
||||
let context = Arc::new(RepositoryContext { db, events });
|
||||
|
||||
Self {
|
||||
server: ServerRepository {
|
||||
|
||||
Reference in New Issue
Block a user