Files
imphnen-backend-service/src/apps/v1/auth/auth_controller.rs
T

18 lines
530 B
Rust
Raw Normal View History

2025-03-14 09:53:20 +07:00
use super::{AuthLoginRequestDto, AuthRegisterRequestDto, AuthService};
2025-02-25 02:00:19 +07:00
use crate::AppState;
2025-03-13 23:40:16 +07:00
use axum::{response::IntoResponse, Extension, Json};
2025-02-25 02:00:19 +07:00
pub async fn post_login(
Extension(state): Extension<AppState>,
Json(payload): Json<AuthLoginRequestDto>,
) -> impl IntoResponse {
2025-03-14 09:53:20 +07:00
AuthService::mutation_login(payload, &state).await
2025-02-08 00:58:54 +07:00
}
2025-03-13 23:40:16 +07:00
pub async fn post_register(
Extension(state): Extension<AppState>,
Json(payload): Json<AuthRegisterRequestDto>,
) -> impl IntoResponse {
2025-03-14 09:53:20 +07:00
AuthService::mutation_register(payload, &state).await
2025-03-13 23:40:16 +07:00
}