Files

45 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

## 1. 类型定义
- [ ] 1.1 在 `src/types/index.ts` 中新增 `SilverBaselineData` 接口
- [ ] 1.2 在 `src/types/index.ts` 中新增 `SilverBaselineAlert` 接口
- [ ] 1.3 在 `src/types/index.ts` 中新增 `SilverBaselineDatabase` 接口
## 2. 数据获取
- [ ] 2.1 在 `ScraperService` 中实现 `fetchSilverPrice()` 方法
- [ ] 2.2 测试白银价格获取功能
## 3. 数据存储
- [ ] 3.1 在 `DatabaseService` 中新增 `loadSilverBaseline()` 方法
- [ ] 3.2 在 `DatabaseService` 中新增 `saveSilverBaseline()` 方法
- [ ] 3.3 在 `DatabaseService` 中新增 `addSilverPrice()` 方法
- [ ] 3.4 在 `DatabaseService` 中新增 `updateSilverBaseline()` 方法
## 4. 监控服务
- [ ] 4.1 创建 `src/services/silver-baseline-monitor.ts` 文件
- [ ] 4.2 实现 `SilverBaselineMonitor` 类
- [ ] 4.3 实现基线初始化逻辑
- [ ] 4.4 实现价格对比和告警触发逻辑
- [ ] 4.5 实现基线更新逻辑
## 5. 告警功能
- [ ] 5.1 在 `AlertService` 中新增 `sendSilverBaselineAlert()` 方法
- [ ] 5.2 设计飞书告警消息格式
- [ ] 5.3 测试飞书告警发送
## 6. 主程序集成
- [ ] 6.1 在 `src/index.ts` 中集成白银基线监控
- [ ] 6.2 配置监控间隔(与现有监控同步)
- [ ] 6.3 实现优雅退出处理
## 7. 配置和文档
- [ ] 7.1 更新 `.env.example` 添加 `SILVER_BASELINE_THRESHOLD` 配置
- [ ] 7.2 更新 `README.md` 添加白银基线监控说明
- [ ] 7.3 创建测试脚本 `test-silver-baseline.ts`
## 8. 测试验证
- [ ] 8.1 运行类型检查 `npm run typecheck`
- [ ] 8.2 运行构建 `npm run build`
- [ ] 8.3 测试白银价格获取
- [ ] 8.4 测试基线初始化
- [ ] 8.5 测试告警触发(模拟价格变化)
- [ ] 8.6 测试基线更新
- [ ] 8.7 验证数据持久化