refactor(chat): wire mapper module into storagelayer entrypoint
zhenyi committed
Modified chat/storagelayer/lib.rs chat/storagelayer/lib.rs +1 −0 View chat/storagelayer/lib.rs
@@ -4,6 +4,7 @@
44
55pub mod blob;
66pub mod error;
7pub mod mapper;
78pub mod mapping;
89pub mod models;
910pub mod repository;
Modified chat/storagelayer/repository.rs chat/storagelayer/repository.rs +7 −0 View chat/storagelayer/repository.rs
@@ -70,6 +70,13 @@
7070pub struct ChatStorageFactory;
7171
7272impl ChatStorageFactory {
73 pub fn from_db(
74 db: Arc<db::conn::Db>,
75 blobs: Arc<dyn crate::blob::ChatMediaStore>,
76 ) -> DynChatStorage {
77 Arc::new(crate::mapper::SeaChatStorage::new(db, blobs))
78 }
79
7380 #[cfg(feature = "mock")]
7481 pub fn in_memory() -> DynChatStorage {
7582 crate::InMemoryChatStorage::new_shared()