1
0

refactor: 移除 success 字段,简化为 matched 单层判定模型

This commit is contained in:
2026-05-11 13:12:55 +08:00
parent 548b44d28e
commit 35ba56888b
93 changed files with 3893 additions and 103 deletions

View File

@@ -0,0 +1,17 @@
## MODIFIED Requirements
### Requirement: 目标列表 API
系统 SHALL 提供 `GET /api/targets` 端点,返回所有目标及其最新状态。
#### Scenario: recentSamples.up 判定
- **WHEN** 系统返回 recentSamples 数组
- **THEN** 每个元素的 `up` 字段 SHALL 为 `matched === true`
### Requirement: 共享类型
系统 SHALL 在 `src/shared/api.ts` 中定义前后端共享的 TypeScript 类型。
#### Scenario: CheckResult 类型
- **THEN** `CheckResult` 类型 SHALL 包含 timestamp、matched、durationMs、statusDetail、failure 字段,不包含 success 字段
#### Scenario: RecentSample 类型
- **THEN** `RecentSample` 类型 SHALL 包含 timestamp、durationMs、up 字段,其中 up 为 boolean 且等于 matched