2021-09-23 17:50:28 +08:00
|
|
|
use crate::service::{doc::ws_handler::DocWsBizHandler, ws::WsBizHandlers};
|
2021-09-23 19:59:58 +08:00
|
|
|
use actix_web::web::Data;
|
|
|
|
use flowy_ws::WsModule;
|
|
|
|
use sqlx::PgPool;
|
2021-09-23 17:50:28 +08:00
|
|
|
use std::sync::Arc;
|
|
|
|
|
2021-09-23 16:10:24 +08:00
|
|
|
pub mod app;
|
|
|
|
pub mod doc;
|
2021-09-16 13:41:07 +08:00
|
|
|
pub(crate) mod log;
|
2021-09-23 16:10:24 +08:00
|
|
|
pub mod user;
|
2021-09-11 14:26:30 +08:00
|
|
|
pub(crate) mod util;
|
2021-09-23 16:10:24 +08:00
|
|
|
pub mod view;
|
|
|
|
pub mod workspace;
|
|
|
|
pub mod ws;
|
2021-09-23 17:50:28 +08:00
|
|
|
|
2021-09-23 19:59:58 +08:00
|
|
|
pub fn make_ws_biz_handlers(pg_pool: Data<PgPool>) -> WsBizHandlers {
|
2021-09-23 17:50:28 +08:00
|
|
|
let mut ws_biz_handlers = WsBizHandlers::new();
|
|
|
|
|
|
|
|
// doc
|
2021-09-23 19:59:58 +08:00
|
|
|
let doc_biz_handler = DocWsBizHandler::new(pg_pool);
|
|
|
|
ws_biz_handlers.register(WsModule::Doc, wrap(doc_biz_handler));
|
2021-09-23 17:50:28 +08:00
|
|
|
|
|
|
|
//
|
|
|
|
ws_biz_handlers
|
|
|
|
}
|
|
|
|
|
2021-09-23 19:59:58 +08:00
|
|
|
fn wrap<T>(val: T) -> Arc<T> { Arc::new(val) }
|