From c932e8d318c82fa4fd87a5037d8f3ca99d16e869 Mon Sep 17 00:00:00 2001 From: Nixevol Date: Thu, 19 Nov 2026 11:47:25 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=94=B9=E4=B8=BA=E5=8D=95?= =?UTF-8?q?=E5=8C=85=E7=BB=93=E6=9E=84=EF=BC=8C=E5=BA=93=E5=92=8C=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E8=A1=8C=E6=94=BE=E5=9C=A8=20src?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 8 -------- Cargo.toml | 22 ++++++++++++++++++---- README.md | 2 +- crates/punchlog-cli/Cargo.toml | 14 -------------- crates/punchlog/Cargo.toml | 18 ------------------ {crates/punchlog/src => src}/analyze.rs | 0 {crates/punchlog/src => src}/auth.rs | 0 {crates/punchlog/src => src}/config.rs | 0 {crates/punchlog/src => src}/error.rs | 0 {crates/punchlog/src => src}/iepms.rs | 0 {crates/punchlog/src => src}/lib.rs | 0 {crates/punchlog-cli/src => src}/main.rs | 0 {crates/punchlog/src => src}/msa.rs | 0 {crates/punchlog/src => src}/record.rs | 0 {crates/punchlog/src => src}/report.rs | 0 15 files changed, 19 insertions(+), 45 deletions(-) delete mode 100644 crates/punchlog-cli/Cargo.toml delete mode 100644 crates/punchlog/Cargo.toml rename {crates/punchlog/src => src}/analyze.rs (100%) rename {crates/punchlog/src => src}/auth.rs (100%) rename {crates/punchlog/src => src}/config.rs (100%) rename {crates/punchlog/src => src}/error.rs (100%) rename {crates/punchlog/src => src}/iepms.rs (100%) rename {crates/punchlog/src => src}/lib.rs (100%) rename {crates/punchlog-cli/src => src}/main.rs (100%) rename {crates/punchlog/src => src}/msa.rs (100%) rename {crates/punchlog/src => src}/record.rs (100%) rename {crates/punchlog/src => src}/report.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 4042028..f791458 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -849,14 +849,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "punchlog-cli" -version = "0.1.0" -dependencies = [ - "chrono", - "punchlog", -] - [[package]] name = "quinn" version = "0.11.12" diff --git a/Cargo.toml b/Cargo.toml index b413aaf..e70bc54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,18 @@ -[workspace] -resolver = "2" -members = ["crates/punchlog", "crates/punchlog-cli"] -default-members = ["crates/punchlog-cli"] +[package] +name = "punchlog" +version = "0.1.0" +edition = "2021" +description = "iCenter 打卡登录、记录拉取与缺卡统计" +publish = false + +[dependencies] +aes-gcm = "0.10" +base64 = "0.22" +chrono = "0.4" +rand = "0.8" +reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls"] } +rsa = { version = "0.9", features = ["sha2", "pem"] } +serde = { version = "1", features = ["derive"] } +serde_json = { version = "1", features = ["preserve_order"] } +sha2 = "0.10" +thiserror = "2" diff --git a/README.md b/README.md index 13f53a4..8a55770 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PunchLog -个人打卡记录。核心逻辑在 `crates/punchlog`,命令行只负责打印最近一周。 +个人打卡记录。核心逻辑在 `src` 库里,`src/main.rs` 只负责打印最近一周。 ```powershell cargo run diff --git a/crates/punchlog-cli/Cargo.toml b/crates/punchlog-cli/Cargo.toml deleted file mode 100644 index e87cfb4..0000000 --- a/crates/punchlog-cli/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "punchlog-cli" -version = "0.1.0" -edition = "2021" -description = "输出最近一周打卡记录" -publish = false - -[[bin]] -name = "punchlog" -path = "src/main.rs" - -[dependencies] -chrono = "0.4" -punchlog = { path = "../punchlog" } diff --git a/crates/punchlog/Cargo.toml b/crates/punchlog/Cargo.toml deleted file mode 100644 index e70bc54..0000000 --- a/crates/punchlog/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -name = "punchlog" -version = "0.1.0" -edition = "2021" -description = "iCenter 打卡登录、记录拉取与缺卡统计" -publish = false - -[dependencies] -aes-gcm = "0.10" -base64 = "0.22" -chrono = "0.4" -rand = "0.8" -reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls"] } -rsa = { version = "0.9", features = ["sha2", "pem"] } -serde = { version = "1", features = ["derive"] } -serde_json = { version = "1", features = ["preserve_order"] } -sha2 = "0.10" -thiserror = "2" diff --git a/crates/punchlog/src/analyze.rs b/src/analyze.rs similarity index 100% rename from crates/punchlog/src/analyze.rs rename to src/analyze.rs diff --git a/crates/punchlog/src/auth.rs b/src/auth.rs similarity index 100% rename from crates/punchlog/src/auth.rs rename to src/auth.rs diff --git a/crates/punchlog/src/config.rs b/src/config.rs similarity index 100% rename from crates/punchlog/src/config.rs rename to src/config.rs diff --git a/crates/punchlog/src/error.rs b/src/error.rs similarity index 100% rename from crates/punchlog/src/error.rs rename to src/error.rs diff --git a/crates/punchlog/src/iepms.rs b/src/iepms.rs similarity index 100% rename from crates/punchlog/src/iepms.rs rename to src/iepms.rs diff --git a/crates/punchlog/src/lib.rs b/src/lib.rs similarity index 100% rename from crates/punchlog/src/lib.rs rename to src/lib.rs diff --git a/crates/punchlog-cli/src/main.rs b/src/main.rs similarity index 100% rename from crates/punchlog-cli/src/main.rs rename to src/main.rs diff --git a/crates/punchlog/src/msa.rs b/src/msa.rs similarity index 100% rename from crates/punchlog/src/msa.rs rename to src/msa.rs diff --git a/crates/punchlog/src/record.rs b/src/record.rs similarity index 100% rename from crates/punchlog/src/record.rs rename to src/record.rs diff --git a/crates/punchlog/src/report.rs b/src/report.rs similarity index 100% rename from crates/punchlog/src/report.rs rename to src/report.rs