diff options
Diffstat (limited to 'src/routers/account.rs')
| -rw-r--r-- | src/routers/account.rs | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/routers/account.rs b/src/routers/account.rs index e8c9753..8192133 100644 --- a/src/routers/account.rs +++ b/src/routers/account.rs | |||
| @@ -2,16 +2,23 @@ use axum::Router; | |||
| 2 | use axum::response::IntoResponse; | 2 | use axum::response::IntoResponse; |
| 3 | use axum::routing::{get, post}; | 3 | use axum::routing::{get, post}; |
| 4 | 4 | ||
| 5 | pub(crate) fn router() -> Router { | 5 | use crate::response::ApiResponse; |
| 6 | Router::new() | ||
| 7 | .route("/me", get(me)) | ||
| 8 | .route("/login", post(login)) | ||
| 9 | } | ||
| 10 | 6 | ||
| 11 | async fn me() -> impl IntoResponse { | 7 | async fn me() -> impl IntoResponse { |
| 12 | "Me" | 8 | ApiResponse::Success("Me") |
| 9 | } | ||
| 10 | |||
| 11 | async fn register() -> impl IntoResponse { | ||
| 12 | ApiResponse::Success("Register") | ||
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | async fn login() -> impl IntoResponse { | 15 | async fn login() -> impl IntoResponse { |
| 16 | "Login" | 16 | ApiResponse::Success("Login") |
| 17 | } | ||
| 18 | |||
| 19 | pub(crate) fn router() -> Router { | ||
| 20 | Router::new() | ||
| 21 | .route("/me", get(me)) | ||
| 22 | .route("/register", post(register)) | ||
| 23 | .route("/login", post(login)) | ||
| 17 | } | 24 | } |
