use crate::ApiResponse; use crate::error::ApiError; use actix_web::{HttpResponse, Result, web}; use service::AppService; use service::auth::captcha::{CaptchaQuery, CaptchaResponse}; use session::Session; #[utoipa::path( post, path = "/api/auth/captcha", request_body = CaptchaQuery, responses( (status = 200, description = "Captcha generated", body = ApiResponse), (status = 500, description = "Internal server error", body = ApiResponse), (status = 404, description = "Not found", body = ApiResponse), ), tag = "Auth" )] pub async fn api_auth_captcha( service: web::Data, session: Session, body: web::Json, ) -> Result { let resp = service.auth_captcha(&session, body.into_inner()).await?; Ok(HttpResponse::Ok().json(ApiResponse::ok(resp))) }