22 lines
592 B
Rust
22 lines
592 B
Rust
use axum::{
|
|
extract::State,
|
|
http::StatusCode,
|
|
response::IntoResponse,
|
|
routing::get,
|
|
Router,
|
|
};
|
|
use crate::auth::structs::AppState;
|
|
|
|
// Define the handler for the /user/ endpoint
|
|
async fn get_user(State(state): State<AppState>) -> impl IntoResponse {
|
|
// Placeholder for user data retrieval logic
|
|
// In a real application, you would query the database using state.db
|
|
(StatusCode::OK, "User data retrieved successfully")
|
|
}
|
|
|
|
// Define the router for the data module
|
|
pub fn router() -> Router<AppState> {
|
|
Router::new()
|
|
.route("/user/", get(get_user))
|
|
}
|