use crate::{ApiResponse, error::ApiError}; use actix_web::{HttpResponse, Result, web}; use service::AppService; use session::Session; #[utoipa::path( get, path = "/api/users/{username}/info", params(("username" = String, Path)), responses( (status = 200, description = "Get user info", body = ApiResponse), (status = 401, description = "Unauthorized"), (status = 404, description = "Not found"), ), tag = "User" )] pub async fn get_user_info( service: web::Data, session: Session, path: web::Path, ) -> Result { let username = path.into_inner(); let resp = service.user_info(session, username).await?; Ok(ApiResponse::ok(resp).to_response()) }