2021-07-05 13:23:13 +00:00
|
|
|
use crate::domain::user::*;
|
2021-07-05 08:54:41 +00:00
|
|
|
use flowy_sys::prelude::*;
|
2021-06-29 15:21:25 +00:00
|
|
|
use std::convert::TryInto;
|
|
|
|
|
2021-06-30 07:33:49 +00:00
|
|
|
// tracing instrument 👉🏻 https://docs.rs/tracing/0.1.26/tracing/attr.instrument.html
|
|
|
|
#[tracing::instrument(
|
2021-07-05 13:23:13 +00:00
|
|
|
name = "user_sign_in",
|
2021-06-30 07:33:49 +00:00
|
|
|
skip(data),
|
|
|
|
fields(
|
|
|
|
email = %data.email,
|
|
|
|
)
|
|
|
|
)]
|
2021-07-05 13:23:13 +00:00
|
|
|
pub async fn user_sign_in(
|
|
|
|
data: Data<UserSignInParams>,
|
|
|
|
) -> ResponseResult<UserSignInResult, String> {
|
|
|
|
let _request: UserSignInRequest = data.into_inner().try_into()?;
|
2021-06-29 15:21:25 +00:00
|
|
|
|
2021-07-05 13:23:13 +00:00
|
|
|
let response = UserSignInResult::new(true);
|
|
|
|
response_ok(response)
|
|
|
|
}
|
|
|
|
|
|
|
|
#[tracing::instrument(
|
|
|
|
name = "user_sign_up",
|
|
|
|
skip(data),
|
|
|
|
fields(
|
|
|
|
email = %data.email,
|
|
|
|
)
|
|
|
|
)]
|
|
|
|
pub async fn user_sign_up(
|
|
|
|
data: Data<UserSignUpParams>,
|
|
|
|
) -> ResponseResult<UserSignUpResult, String> {
|
|
|
|
let _request: UserSignUpRequest = data.into_inner().try_into()?;
|
|
|
|
|
|
|
|
let response = UserSignUpResult::new(true);
|
|
|
|
response_ok(response)
|
2021-06-29 15:21:25 +00:00
|
|
|
}
|