Skip to content

Commit

Permalink
refactor: remove swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
ParzivalEugene committed Aug 10, 2024
1 parent 0f2a9ee commit 4f11587
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 179 deletions.
88 changes: 13 additions & 75 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ tower = { version = "0.4.13", features = ["full"] }
tower-http = { version = "0.5.0", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
utoipa = { version = "4.2", features = ["axum_extras", "chrono", "uuid"] }
uuid = { version = "1.10", features = [
"serde",
"v4",
Expand Down
5 changes: 1 addition & 4 deletions src/data/enums/device_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ use diesel::{
serialize::{self, IsNull, Output, ToSql},
};
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;

#[derive(
Debug, AsExpression, FromSqlRow, PartialEq, Eq, Clone, Copy, Serialize, Deserialize, ToSchema,
)]
#[derive(Debug, AsExpression, FromSqlRow, PartialEq, Eq, Clone, Copy, Serialize, Deserialize)]
#[diesel(sql_type = crate::data::schema::sql_types::DeviceStatus)]
pub enum DeviceStatus {
LoggedIn,
Expand Down
5 changes: 1 addition & 4 deletions src/data/enums/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ use diesel::{
serialize::{self, IsNull, Output, ToSql},
};
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;

#[derive(
Debug, AsExpression, FromSqlRow, PartialEq, Eq, Clone, Copy, Serialize, Deserialize, ToSchema,
)]
#[derive(Debug, AsExpression, FromSqlRow, PartialEq, Eq, Clone, Copy, Serialize, Deserialize)]
#[diesel(sql_type = crate::data::schema::sql_types::Os)]
#[allow(
non_camel_case_types,
Expand Down
3 changes: 1 addition & 2 deletions src/dto/auth/request/authorize.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::{data::enums::OAuthProvider, dto::device::internal::DeviceInfo};
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;

#[derive(Debug, Serialize, Deserialize, Clone, ToSchema)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct AuthorizeRequest {
pub code: String,
pub provider: OAuthProvider,
Expand Down
4 changes: 1 addition & 3 deletions src/dto/auth/request/change_password.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;

#[derive(Debug, Serialize, Deserialize, ToSchema, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ChangePasswordRequest {
#[schema(example = "strong_password")]
pub password: String,
}
5 changes: 1 addition & 4 deletions src/dto/auth/request/sign_in.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
use crate::dto::device::internal::DeviceInfo;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;

#[derive(Debug, Serialize, Deserialize, ToSchema, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct SignInRequest {
#[schema(example = "vitya@gmail.com")]
pub email: String,
#[schema(example = "strong_password")]
pub password: String,
pub device: DeviceInfo,
}
5 changes: 1 addition & 4 deletions src/dto/auth/request/sign_up.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
use crate::dto::device::internal::DeviceInfo;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;

#[derive(Debug, Serialize, Deserialize, ToSchema, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct SignUpRequest {
#[schema(example = "vitya@gmail.com")]
pub email: String,
#[schema(example = "strong_password")]
pub password: String,
pub device: DeviceInfo,
}
3 changes: 1 addition & 2 deletions src/dto/auth/response/tokens.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;

#[derive(Debug, Deserialize, Serialize, ToSchema)]
#[derive(Debug, Deserialize, Serialize)]
pub struct Tokens {
pub access_token: String,
pub refresh_token: String,
Expand Down
5 changes: 1 addition & 4 deletions src/dto/device/internal/device_info.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
use crate::data::enums::OS;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;

#[derive(Debug, Serialize, Deserialize, ToSchema, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct DeviceInfo {
#[schema(example = "Android")]
pub os: OS,
#[schema(example = "Vitya Phone")]
pub name: String,
}
3 changes: 1 addition & 2 deletions src/dto/device/response/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ use crate::data::{
models,
};
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
use uuid::Uuid;

#[derive(Debug, Serialize, Deserialize, ToSchema, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Device {
pub id: Uuid,
pub name: String,
Expand Down
3 changes: 1 addition & 2 deletions src/dto/session/request/create_session.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::data::enums::Country;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;

#[derive(Debug, Serialize, Deserialize, ToSchema, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct CreateSession {
pub country: Country,
}
3 changes: 1 addition & 2 deletions src/dto/session/response/session.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use crate::data::models;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
use uuid::Uuid;

#[derive(Debug, Serialize, Deserialize, ToSchema, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Session {
pub session_id: Uuid,
pub server_public_key: String,
Expand Down
Loading

0 comments on commit 4f11587

Please sign in to comment.