chore: add base config and package structure

This commit is contained in:
ila
2026-07-04 23:24:51 +08:00
parent 5a7ea348e5
commit 79c57a63c5
14 changed files with 96 additions and 6 deletions
+9
View File
@@ -79,3 +79,12 @@
- 阻塞:无。
- 决策:T-001 采用标准库 `unittest` 做最小 factory / health check 验证;后续 T-003 再建立 pytest 测试框架。
- 下一步:T-002 建立基础配置与目录。
## 2026-07-04 T-002 建立基础配置与目录
- 状态:DONE
- 变更:新增 `app/middleware/`、`app/services/`、`app/mappers/`、`app/chis/`、`app/repositories/`、`app/validators/` 包目录;新增 `.env.example`;更新 `app/config.py` 从环境变量读取基础配置;更新 `create_app` 加载基础配置;新增 `tests/test_config_and_structure.py`;更新任务和当前状态文档。
- 验证:先执行 `python -m unittest discover -s tests` 看到 `CHIS_BASE_URL` 缺失和架构包不可导入;实现后执行 `python -m unittest discover -s tests` 结果 `Ran 3 tests ... OK`;临时启动 `python run.py` 后请求 `/health` 返回 `{"ok":true}`;执行 `git diff --check` 未发现空白错误;检查 `.env.example` 仅包含占位符和非敏感默认值。
- 阻塞:无。
- 决策:T-002 只建立基础配置和包目录,不引入真实密钥、不连接 Redis、不实现 CHIS 业务逻辑。
- 下一步:T-003 建立最小测试框架。