feature/upstream-service #13

Merged
GW_MC merged 43 commits from feature/upstream-service into master 2026-01-01 10:49:32 +08:00
Showing only changes of commit cb65d4e9f7 - Show all commits

View File

@@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize};
use tracing::error; use tracing::error;
use crate::{ use crate::{
middlewares::request_info::RequestInfo, middlewares::request_info::AuthenticatedRequestInfo,
routes::{AppState, api::openapi::tag::USER_TAG}, routes::{AppState, api::openapi::tag::USER_TAG},
}; };
@@ -38,15 +38,9 @@ pub struct UserInfo {
)] )]
pub async fn get_user_info( pub async fn get_user_info(
State(app_state): State<Arc<AppState>>, State(app_state): State<Arc<AppState>>,
request_info: Extension<Arc<RequestInfo>>, request_info: AuthenticatedRequestInfo,
) -> Response { ) -> Response {
let user_id = match request_info.user_id { let user_id = request_info.user_id;
Some(id) => id,
None => {
error!("User ID not found in request info");
return (StatusCode::UNAUTHORIZED).into_response();
}
};
match app_state.service.user.get_user_by_id(user_id, None).await { match app_state.service.user.get_user_by_id(user_id, None).await {
Ok(user) => { Ok(user) => {