refactor: 改为单包结构,库和命令行放在 src

This commit is contained in:
2026-11-19 11:47:25 +08:00
parent b948f7a5d3
commit c932e8d318
15 changed files with 19 additions and 45 deletions
+23
View File
@@ -0,0 +1,23 @@
use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, Error)]
pub enum Error {
#[error("缺少配置: {0}")]
MissingConfig(String),
#[error("登录失败: {0}")]
Login(String),
#[error("登录凭据已失效")]
AuthExpired,
#[error("拉取打卡记录失败: {0}")]
Attendance(String),
#[error("网络请求失败: {0}")]
Http(#[from] reqwest::Error),
#[error("加解密失败: {0}")]
Crypto(String),
#[error("解析响应失败: {0}")]
Parse(String),
#[error("{0}")]
Io(#[from] std::io::Error),
}