first
This commit is contained in:
21
src/data/data.rs
Normal file
21
src/data/data.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
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))
|
||||
}
|
||||
Reference in New Issue
Block a user