mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-07-27 19:11:09 +00:00
28 lines
971 B
Rust
28 lines
971 B
Rust
![]() |
use crate::{
|
||
|
entities::doc::{CreateDocParams, Doc, QueryDocParams, UpdateDocParams},
|
||
|
errors::DocError,
|
||
|
services::server::DocumentServerAPI,
|
||
|
};
|
||
|
use flowy_infra::{future::ResultFuture, uuid};
|
||
|
pub struct DocServerMock {}
|
||
|
|
||
|
impl DocumentServerAPI for DocServerMock {
|
||
|
fn create_doc(&self, _token: &str, _params: CreateDocParams) -> ResultFuture<Doc, DocError> {
|
||
|
let uuid = uuid();
|
||
|
let doc = Doc {
|
||
|
id: uuid,
|
||
|
data: "".to_string(),
|
||
|
};
|
||
|
|
||
|
ResultFuture::new(async { Ok(doc) })
|
||
|
}
|
||
|
|
||
|
fn read_doc(&self, _token: &str, _params: QueryDocParams) -> ResultFuture<Option<Doc>, DocError> {
|
||
|
ResultFuture::new(async { Ok(None) })
|
||
|
}
|
||
|
|
||
|
fn update_doc(&self, _token: &str, _params: UpdateDocParams) -> ResultFuture<(), DocError> { ResultFuture::new(async { Ok(()) }) }
|
||
|
|
||
|
fn delete_doc(&self, _token: &str, _params: QueryDocParams) -> ResultFuture<(), DocError> { ResultFuture::new(async { Ok(()) }) }
|
||
|
}
|