23 lines
525 B
Rust
Raw Normal View History

2021-08-21 17:17:54 +08:00
use flowy_net::response::{ServerCode, ServerError};
2021-08-21 13:35:15 +08:00
use flowy_user::{entities::SignUpResponse, protobuf::SignUpParams};
2021-08-19 22:48:10 +08:00
use sqlx::PgPool;
use std::sync::Arc;
pub struct Auth {
db_pool: Arc<PgPool>,
}
impl Auth {
pub fn new(db_pool: Arc<PgPool>) -> Self { Self { db_pool } }
2021-08-21 17:17:54 +08:00
pub fn sign_up(&self, params: SignUpParams) -> Result<SignUpResponse, ServerError> {
2021-08-21 13:35:15 +08:00
// email exist?
// generate user id
unimplemented!()
}
2021-08-21 17:17:54 +08:00
pub fn is_email_exist(&self, email: &str) -> bool { true }
2021-08-19 22:48:10 +08:00
}