pre-metrics

This commit is contained in:
2026-05-15 19:35:06 +02:00
parent 0b441b0759
commit 132057217d
43 changed files with 1170 additions and 170 deletions
+6 -7
View File
@@ -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 {