Skip to content
Clone
590c07b
108 lines 4.0 KB Rust
use utoipa::OpenApi;
#[derive(OpenApi)]
#[openapi(
info(
title = "auth",
description = "认证与账号服务:工作量证明、口令与验证码登录、二次验证、注册、口令重置。",
version = env!("CARGO_PKG_VERSION")
),
paths(
crate::handlers::challenge::challenge,
crate::handlers::login::login,
crate::handlers::login::login_code,
crate::handlers::login::login_code_verify,
crate::handlers::login::login_verify,
crate::handlers::logout::logout,
crate::handlers::identity_me::me,
crate::handlers::register::register_code,
crate::handlers::register::register,
crate::handlers::password_reset::password_reset_request,
crate::handlers::password_reset::password_reset,
),
components(schemas(
))
)]
pub struct ApiDoc;
use export::rest::NoData;
use models::users::user_notifications::NotificationType;
use crate::handlers;
use crate::handlers::accept_agreement::AcceptAgreementCmd;
use crate::handlers::me::MeResp;
use crate::handlers::unread_notifications_count::UnreadCountResp;
use crate::services::agreements::AcceptAgreementResp;
use crate::services::notifications::NotificationDto;
use crate::services::preferences::{UpdatePreferencesCmd, UserPreferencesDto};
use crate::services::profile::{ProfileDto, UpdateProfileCmd, UserMeDto};
use crate::services::reports::{CreateReportCmd, ReportDto};
use crate::share::account::types::{AgreementDoc, UserPublic};
#[derive(OpenApi)]
#[openapi(
info(title = "gitdata auth api", version = "1.0"),
paths(
handlers::accept_agreement::accept_agreement,
handlers::create_report::create_report,
handlers::delete_notification::delete_notification,
handlers::get_preferences::get_preferences,
handlers::get_user::get_user,
handlers::users::list_users_batch,
handlers::users::get_user_by_username,
handlers::users::update_username,
handlers::list_agreements::list_agreements,
handlers::list_notifications::list_notifications,
handlers::mark_notifications_read::mark_notifications_read,
handlers::me::me,
handlers::unread_notifications_count::unread_notifications_count,
handlers::update_preferences::update_preferences,
handlers::update_profile::update_profile,
handlers::password::change_password,
handlers::two_factor::totp_status,
handlers::two_factor::totp_setup,
handlers::two_factor::totp_enable,
handlers::two_factor::totp_disable,
handlers::two_factor::recovery_codes,
handlers::two_factor::regenerate_recovery_codes,
handlers::sessions::list_sessions,
handlers::sessions::revoke_all_sessions,
handlers::sessions::revoke_session,
handlers::devices::list_devices,
),
components(schemas(
export::pagination::PageQuery,
export::pagination::Page<NotificationDto>,
handlers::mark_notifications_read::MarkNotificationsReadCmd,
handlers::mark_notifications_read::MarkedCountResp,
NoData,
UserPublic,
AgreementDoc,
UserMeDto,
ProfileDto,
UpdateProfileCmd,
UserPreferencesDto,
UpdatePreferencesCmd,
AcceptAgreementCmd,
AcceptAgreementResp,
MeResp,
NotificationDto,
CreateReportCmd,
ReportDto,
UnreadCountResp,
NotificationType,
handlers::password::ChangePasswordCmd,
handlers::two_factor::TotpStatusResp,
handlers::two_factor::TotpSetupResp,
handlers::two_factor::TotpEnableCmd,
handlers::two_factor::TotpCodeCmd,
handlers::two_factor::RegenerateRecoveryCodesCmd,
handlers::two_factor::RecoveryCodesResp,
handlers::sessions::SessionDto,
handlers::sessions::SessionKind,
handlers::sessions::CountResp,
export::pagination::Page<handlers::sessions::SessionDto>,
handlers::devices::DeviceDto,
))
)]
pub struct AuthApiDoc;