use flowy_user::{ entities::{SignInParams, SignUpParams, UserDetail}, errors::{ErrorBuilder, UserError, UserErrorCode}, prelude::UserServer, sql_tables::UserTable, }; pub type ArcFlowyServer = std::sync::Arc; pub trait FlowyServer: UserServer {} pub struct FlowyServerMocker {} impl FlowyServer for FlowyServerMocker {} impl UserServer for FlowyServerMocker { fn sign_up(&self, params: SignUpParams) -> Result { let user_id = params.email.clone(); Ok(UserTable::new( user_id, params.name, params.email, params.password, )) } fn sign_in(&self, params: SignInParams) -> Result { let user_id = params.email.clone(); Ok(UserTable::new( user_id, "".to_owned(), params.email, params.password, )) } fn get_user_info(&self, _user_id: &str) -> Result { Err(ErrorBuilder::new(UserErrorCode::Unknown).build()) } fn sign_out(&self, _user_id: &str) -> Result<(), UserError> { Err(ErrorBuilder::new(UserErrorCode::Unknown).build()) } }