diff --git a/Cargo.lock b/Cargo.lock index af03162..06b1c59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -66,21 +66,6 @@ version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" -[[package]] -name = "api" -version = "0.1.0" -dependencies = [ - "axum", - "axum-extra", - "domain", - "library", - "service", - "tokio", - "tower-http", - "tracing", - "validator", -] - [[package]] name = "async-lock" version = "3.4.0" @@ -307,10 +292,10 @@ dependencies = [ name = "chuanyue-service" version = "0.1.0" dependencies = [ - "api", "job", "library", "mimalloc", + "system", "tokio", ] @@ -2013,23 +1998,6 @@ dependencies = [ "serde", ] -[[package]] -name = "service" -version = "0.1.0" -dependencies = [ - "chrono", - "domain", - "error-stack", - "futures-executor", - "i18n", - "lazy_static", - "library", - "moka", - "reqwest", - "sqlx", - "tracing", -] - [[package]] name = "sha1" version = "0.10.6" @@ -2412,6 +2380,28 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +[[package]] +name = "system" +version = "0.1.0" +dependencies = [ + "axum", + "axum-extra", + "chrono", + "domain", + "error-stack", + "futures-executor", + "i18n", + "lazy_static", + "library", + "moka", + "reqwest", + "sqlx", + "tokio", + "tower-http", + "tracing", + "validator", +] + [[package]] name = "system-configuration" version = "0.5.1" diff --git a/Cargo.toml b/Cargo.toml index e73d1b2..db6227f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [workspace] -members = [".", "api", "domain", "i18n", "job","library", "service"] +members = [".", "system", "domain", "i18n", "job","library"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -12,7 +12,7 @@ members = [".", "api", "domain", "i18n", "job","library", "service"] tokio = { workspace = true, features = ["full"]} mimalloc = { workspace = true } -api = { path = "api" } +system = { path = "system" } library = { path = "library" } job = { path = "job" } diff --git a/api/Cargo.toml b/api/Cargo.toml deleted file mode 100644 index 7bc052e..0000000 --- a/api/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "api" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -axum = { workspace = true } -tokio = { workspace = true, features = ["full"] } -tracing = { workspace = true } -tower-http = { workspace = true, features = ["trace"] } -validator = { workspace = true } -axum-extra = { workspace = true } - -library = { path = "../library" } -domain = { path = "../domain" } -service = { path = "../service" } - diff --git a/src/main.rs b/src/main.rs index db4db42..df13deb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,5 +10,5 @@ async fn main() { library::core::db::init_database(config!()).await; job::start().await; - api::serve().await; + system::serve().await; } diff --git a/service/Cargo.toml b/system/Cargo.toml similarity index 68% rename from service/Cargo.toml rename to system/Cargo.toml index 34d6d83..8764bf3 100644 --- a/service/Cargo.toml +++ b/system/Cargo.toml @@ -1,12 +1,17 @@ [package] -name = "service" +name = "system" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +axum = { workspace = true } +tokio = { workspace = true, features = ["full"] } tracing = { workspace = true } +tower-http = { workspace = true, features = ["trace"] } +validator = { workspace = true } +axum-extra = { workspace = true } chrono = { workspace = true } reqwest = { workspace = true } futures-executor = { workspace = true } diff --git a/api/src/controller/account.rs b/system/src/controller/account.rs similarity index 98% rename from api/src/controller/account.rs rename to system/src/controller/account.rs index c17ad7a..ab7c17e 100644 --- a/api/src/controller/account.rs +++ b/system/src/controller/account.rs @@ -2,6 +2,8 @@ use axum::{Extension, Json}; use domain::{dto::account::{AuthenticateGooleAccountReq, AuthenticateWithPassword, RefreshToken}, vo::account::{LoginAccount, RefreshTokenResult}}; use library::{context::{Context, WhiteContext}, res::{response::{ ResData, ResResult}, validator}}; +use crate::service; + /// google账号登录 pub async fn authenticate_google( Extension(context): Extension, diff --git a/api/src/controller/feedback.rs b/system/src/controller/feedback.rs similarity index 97% rename from api/src/controller/feedback.rs rename to system/src/controller/feedback.rs index 777e283..a89efb8 100644 --- a/api/src/controller/feedback.rs +++ b/system/src/controller/feedback.rs @@ -8,6 +8,8 @@ use library::res::pageable::Pageable; use library::res::response::{ResData, ResResult}; use library::res::validator; +use crate::service; + /// 添加反馈信息 pub async fn add_feedback( Extension(context): Extension, diff --git a/api/src/controller/mod.rs b/system/src/controller/mod.rs similarity index 100% rename from api/src/controller/mod.rs rename to system/src/controller/mod.rs diff --git a/api/src/lib.rs b/system/src/lib.rs similarity index 96% rename from api/src/lib.rs rename to system/src/lib.rs index f16069b..bb2792f 100644 --- a/api/src/lib.rs +++ b/system/src/lib.rs @@ -2,6 +2,7 @@ use library::config; mod controller; mod router; +mod service; /// 启动服务 pub async fn serve() { diff --git a/api/src/router.rs b/system/src/router.rs similarity index 100% rename from api/src/router.rs rename to system/src/router.rs diff --git a/service/src/account.rs b/system/src/service/account.rs similarity index 100% rename from service/src/account.rs rename to system/src/service/account.rs diff --git a/service/src/feedback.rs b/system/src/service/feedback.rs similarity index 100% rename from service/src/feedback.rs rename to system/src/service/feedback.rs diff --git a/service/src/lib.rs b/system/src/service/mod.rs similarity index 100% rename from service/src/lib.rs rename to system/src/service/mod.rs diff --git a/service/src/social.rs b/system/src/service/social.rs similarity index 100% rename from service/src/social.rs rename to system/src/service/social.rs diff --git a/service/src/sys_account.rs b/system/src/service/sys_account.rs similarity index 100% rename from service/src/sys_account.rs rename to system/src/service/sys_account.rs