From c8c6d4cf0ac607fb6c3514ddbdaa37741bae1572 Mon Sep 17 00:00:00 2001 From: Mika Bomm Date: Thu, 3 Apr 2025 11:11:26 +0200 Subject: [PATCH] refactor: remove entity crate and update dependencies in backend --- Cargo.toml | 8 +------- crates/backend/Cargo.toml | 1 - crates/backend/src/db.rs | 1 - crates/backend/src/db/entity.rs | 1 - crates/backend/src/db/user.rs | 4 +++- crates/entity/Cargo.toml | 8 -------- crates/entity/src/lib.rs | 8 -------- crates/xtask/src/main.rs | 2 +- 8 files changed, 5 insertions(+), 28 deletions(-) delete mode 100644 crates/backend/src/db/entity.rs delete mode 100644 crates/entity/Cargo.toml delete mode 100644 crates/entity/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 1fdb127..45dc1a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,5 @@ [workspace] -members = [ - "crates/backend", - "crates/entity", - "crates/migration", - "crates/xtask", -] +members = ["crates/backend", "crates/migration", "crates/xtask"] resolver = "3" [workspace.package] @@ -13,7 +8,6 @@ version = "0.1.0" edition = "2024" [workspace.dependencies] -entity = { path = "crates/entity" } migration = { path = "crates/migration" } serde = { version = "*", features = ["derive"] } diff --git a/crates/backend/Cargo.toml b/crates/backend/Cargo.toml index fbeff56..b61d478 100644 --- a/crates/backend/Cargo.toml +++ b/crates/backend/Cargo.toml @@ -4,7 +4,6 @@ version = { workspace = true } edition = { workspace = true } [dependencies] -entity = { workspace = true } migration = { workspace = true } actix-web = "4" diff --git a/crates/backend/src/db.rs b/crates/backend/src/db.rs index 3a96ee3..cd40126 100644 --- a/crates/backend/src/db.rs +++ b/crates/backend/src/db.rs @@ -1,6 +1,5 @@ use sea_orm::{ConnectOptions, DatabaseConnection}; -mod auth; pub mod entity; mod group; pub mod project; diff --git a/crates/backend/src/db/entity.rs b/crates/backend/src/db/entity.rs deleted file mode 100644 index 8b13789..0000000 --- a/crates/backend/src/db/entity.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/crates/backend/src/db/user.rs b/crates/backend/src/db/user.rs index f4f0b8b..be20e42 100644 --- a/crates/backend/src/db/user.rs +++ b/crates/backend/src/db/user.rs @@ -3,7 +3,9 @@ use super::Database; impl Database { async fn create_user() {} - async fn verify_user() {} + async fn verify_local_user() {} + + async fn verify_ldap_user() {} async fn change_user_password() {} } diff --git a/crates/entity/Cargo.toml b/crates/entity/Cargo.toml deleted file mode 100644 index 32b3d5c..0000000 --- a/crates/entity/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "entity" -version = { workspace = true } -edition = { workspace = true } - -[dependencies] -serde = { workspace = true } -sea-orm = { workspace = true } diff --git a/crates/entity/src/lib.rs b/crates/entity/src/lib.rs deleted file mode 100644 index 8d75c11..0000000 --- a/crates/entity/src/lib.rs +++ /dev/null @@ -1,8 +0,0 @@ -//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.4 - -pub mod prelude; - -pub mod group; -pub mod project; -pub mod user; -pub mod user_group_project; diff --git a/crates/xtask/src/main.rs b/crates/xtask/src/main.rs index 4f0e8ce..1bf588a 100644 --- a/crates/xtask/src/main.rs +++ b/crates/xtask/src/main.rs @@ -50,7 +50,7 @@ fn main() { .expect("running entity generate"); } Some(("clean", _)) => { - let dir = workspace_dir.join("crates/entity/src"); + let dir = workspace_dir.join("crates/backend/src/db/entity"); let files = dir.read_dir().expect("Failed to read entity directory"); for file in files { let file = file.expect("failed to get file path");