Alexey Velikiy
3 years ago
5 changed files with 39 additions and 50 deletions
@ -1,27 +1,27 @@
|
||||
use hastic::services::user_service; |
||||
|
||||
use warp::filters::method::post; |
||||
use warp::http::HeaderValue; |
||||
use warp::hyper::Body; |
||||
use warp::{http::Response, Filter}; |
||||
use warp::{Rejection, Reply}; |
||||
use warp::filters::method::post; |
||||
use warp::{Filter, http::Response }; |
||||
|
||||
use serde::{ Serialize }; |
||||
use serde::Serialize; |
||||
|
||||
use crate::api; |
||||
|
||||
#[derive(Serialize)] |
||||
struct SigninResp { |
||||
token: user_service::AccessToken |
||||
token: user_service::AccessToken, |
||||
} |
||||
|
||||
|
||||
|
||||
pub fn get_route() -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { |
||||
return warp::path!("api" / "auth" / "signin") |
||||
.and(post()) |
||||
.and(warp::body::json()) |
||||
.map(|user: user_service::User| { |
||||
api::API::json(&SigninResp { token: "asdad".to_string() }) |
||||
api::API::json(&SigninResp { |
||||
token: "asdad".to_string(), |
||||
}) |
||||
}); |
||||
} |
||||
} |
||||
|
@ -1,7 +1,6 @@
|
||||
mod api; |
||||
|
||||
|
||||
#[tokio::main] |
||||
async fn main() { |
||||
api::API::serve().await; |
||||
} |
||||
} |
||||
|
@ -1,4 +1 @@
|
||||
struct DataService { |
||||
|
||||
} |
||||
|
||||
struct DataService {} |
||||
|
Loading…
Reference in new issue