docs: 蚕房健康画像(#24)变更记录与开发交接记录

This commit is contained in:
weijuesen
2026-08-13 14:36:35 +08:00
parent 008a7b1d4c
commit e9991a2954
2 changed files with 28 additions and 0 deletions
+20
View File
@@ -517,6 +517,26 @@
---
## 2026-08-13 模块:蚕房健康画像与年度发病统计(计划 #24)
### 做了什么
- `/health-profiles/:roomId`(巡检/LAMP/事件聚合 → 健康分 + 评级);`/trace-records/monthly-stats`(年度按月发病);Web 蚕房「健康画像」抽屉 + 溯源页年度折线图。
### 思路与决策
- 健康分扣分制:红 -25/橙 -12/黄 -4、LAMP 阳性率 -30、会诊 -10、溯源 -8,钳制 0-100;评级 优≥85/良≥70/中≥55/差;
- 月度聚合复用 trace_records(发病事件)按 `to_char(created_at,'YYYY-MM')` 分组;
- 踩坑记录(重要):Gin 不允许在 `:id` 参数节点下再挂子路由(`/rooms/:id/health-profile``/rooms/:id` 冲突 panic)→ 独立路径;同名路由注册函数重复注册会 panic;用 `apply_patch` 新增文件时若文件已存在会覆盖旧文件(原 `health.go``/health` 路由被覆盖,已恢复);handler 读取路由参数必须与 `:param` 命名一致。
### 验证与部署
- 3 组单测(TDD 红→绿);三端构建通过;
- 2026-08-13 第二次发布(含 4 处修复);冒烟:蚕房1# score=96 优(risk 黄 1);
- 相关提交:`cbcb22e`/`ccda60e`(功能)、`725d98a`/`492d1ef`/`3e9916a`/`008a7b1`(修复);回滚见服务器 README。
---
## 环境与踩坑备忘(新同事必读)
- **VPN**:开发服务器经 NetBird 访问;服务 Running 后需 `netbird up`,登录走 SSO(管理端 `115.191.19.95:6680`)。