generated from t/malachite
add: api routes
This commit is contained in:
parent
d7ee379a9a
commit
ce9ce4f635
16 changed files with 1119 additions and 109 deletions
|
@ -6,10 +6,18 @@ use crate::config::Config;
|
|||
use buckets_core::{Config as BucketsConfig, DataManager as BucketsManager};
|
||||
use oiseau::{execute, postgres::DataManager as OiseauManager, postgres::Result as PgResult};
|
||||
use std::collections::HashMap;
|
||||
use tetratto_core::model::{Error, Result};
|
||||
use tetratto_core::{
|
||||
DataManager as TetrattoManager,
|
||||
config::Config as TetrattoConfig,
|
||||
model::{Error, Result},
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct DataManager(pub OiseauManager<Config>, pub BucketsManager);
|
||||
pub struct DataManager(
|
||||
pub OiseauManager<Config>,
|
||||
pub BucketsManager,
|
||||
pub TetrattoManager,
|
||||
);
|
||||
|
||||
impl DataManager {
|
||||
/// Create a new [`DataManager`].
|
||||
|
@ -22,7 +30,15 @@ impl DataManager {
|
|||
.await
|
||||
.expect("failed to create buckets manager");
|
||||
|
||||
Ok(Self(OiseauManager::new(config).await?, buckets_manager))
|
||||
let tetratto_manager = TetrattoManager::new(TetrattoConfig::get_config())
|
||||
.await
|
||||
.expect("failed to create tetratto manager");
|
||||
|
||||
Ok(Self(
|
||||
OiseauManager::new(config).await?,
|
||||
buckets_manager,
|
||||
tetratto_manager,
|
||||
))
|
||||
}
|
||||
|
||||
/// Initialize tables.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue