2021-09-09 15:43:05 +08:00
|
|
|
use crate::{
|
2021-09-22 23:21:44 +08:00
|
|
|
entities::doc::{CreateDocParams, Doc, QueryDocParams, UpdateDocParams},
|
2021-09-09 15:43:05 +08:00
|
|
|
errors::DocError,
|
|
|
|
services::server::DocumentServerAPI,
|
|
|
|
};
|
2021-09-09 17:34:01 +08:00
|
|
|
use flowy_infra::future::ResultFuture;
|
2021-09-09 15:43:05 +08:00
|
|
|
pub struct DocServerMock {}
|
|
|
|
|
|
|
|
impl DocumentServerAPI for DocServerMock {
|
2021-09-10 15:53:24 +08:00
|
|
|
fn create_doc(&self, _token: &str, _params: CreateDocParams) -> ResultFuture<(), DocError> { ResultFuture::new(async { Ok(()) }) }
|
2021-09-09 15:43:05 +08:00
|
|
|
|
|
|
|
fn read_doc(&self, _token: &str, _params: QueryDocParams) -> ResultFuture<Option<Doc>, DocError> {
|
|
|
|
ResultFuture::new(async { Ok(None) })
|
|
|
|
}
|
|
|
|
|
2021-09-22 23:21:44 +08:00
|
|
|
fn update_doc(&self, _token: &str, _params: UpdateDocParams) -> ResultFuture<(), DocError> { ResultFuture::new(async { Ok(()) }) }
|
2021-09-09 15:43:05 +08:00
|
|
|
|
|
|
|
fn delete_doc(&self, _token: &str, _params: QueryDocParams) -> ResultFuture<(), DocError> { ResultFuture::new(async { Ok(()) }) }
|
|
|
|
}
|