feat: 实现配置加载系统与多级目录递归扫描

- 定义支持“一接口一文件”与“一文件多接口”的数据模型
- 实现基于路径首段的 HashMap 索引构建逻辑
- 新增集成测试 tests/integration_test.rs,验证 YAML 解析与目录递归加载
- 优化 Cargo.toml 配置,解决连字符项目名引用问题
This commit is contained in:
CNWei
2025-12-25 18:01:09 +08:00
parent 9a48c156c8
commit 748cfa8e7f
11 changed files with 395 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
[package]
name = "mock-server"
name = "mock_server"
version = "0.1.0"
edition = "2024"
@@ -18,11 +18,14 @@ serde_yaml = "0.9.34+deprecated"
serde_json = "1.0.147"
# 物理目录递归扫描工具
#walkdir = "2.5.0"
walkdir = "2.5.0"
# 性能优化:快速哈希(可选,用于路由匹配)
#dashmap = "7.0.0-rc2"
# 热加载支持(扩展功能)
#notify = "8.2.0"
# 路径处理
#pathdiff = "0.2.3"
#pathdiff = "0.2.3"
[dev-dependencies]
tempfile = "3.24.0"